Changes between Version 13 and Version 14 of UserGuide/Service/Upstart


Ignore:
Timestamp:
02/11/2013 02:30:44 PM (11 years ago)
Author:
Cas
Comment:

add comments & description to job scripts and reword sections

Legend:

Unmodified
Added
Removed
Modified
  • UserGuide/Service/Upstart

    v13 v14  
    88 
    99{{{ 
    10 # sudo adduser --system --group --home /var/lib/deluge deluge 
     10sudo adduser --system --group --home /var/lib/deluge deluge 
    1111}}} 
    1212 
     
    1616 
    1717{{{ 
    18 # sudo adduser <username> deluge 
     18sudo adduser <username> deluge 
    1919}}} 
    2020 
    21 == Deluge Daemon (deluged) Upstart Script == 
     21== Deluge Daemon (deluged) Job == 
    2222 
    23 Create the file `/etc/init/deluged.conf` with the following code and set uid and gid to the user and group you wish to run `deluged` as: 
     23Create the file `/etc/init/deluged.conf` with the following code and set `uid` and `gid` to the user and group you wish to run `deluged` as: 
    2424{{{ 
     25# deluged - Deluge daemon 
     26# 
     27# The daemon component of Deluge BitTorrent client. Deluge UI clients 
     28# connect to this daemon via DelugeRPC protocol. 
     29 
     30description "Deluge daemon" 
     31author "Deluge Team" 
     32 
    2533start on filesystem and stopped networking 
    2634stop on runlevel [016] 
     
    4149 Refer to [http://en.wikipedia.org/wiki/Umask#Octal_umasks Wikipedia] for details of possible values and their effects. Deluged must be stopped and started instead of just restarted after changes. If you enable logging, as described later in this page, the umasks specified here also affect the permissions of newly created logs. 
    4250 
    43 == Deluge Web UI (deluge-web) Upstart Script == 
     51== Deluge Web UI (deluge-web) Job == 
    4452 
    45 '''Put this in /etc/init/deluge-web.conf, remember to set uid and gid to your preference:''' 
     53Create the file `/etc/init/deluge-web.conf` with the following code and set `uid` and `gid` as required:''' 
    4654{{{ 
     55# deluge-web - Deluge Web UI 
     56# 
     57# The Web UI component of Deluge BitTorrent client, connects to deluged and 
     58# provides a web application interface for users. Default url: http://localhost:8112 
     59 
     60description "Deluge Web UI" 
     61author "Deluge Team" 
     62 
    4763start on started deluged 
    4864stop on stopping deluged 
     
    5773exec start-stop-daemon -S -c $uid:$gid -k $umask -x /usr/bin/deluge-web 
    5874}}} 
    59  * Note: The use of a umask with deluge-web is believed to only affect the permissions of plugin scripts installed through the web UI and, if you enable logging, deluge-web logs. 
    60   * 027 grants full access to the user deluge is running as, read access to members of the group that deluge is running as and prevents access from all other accounts.[[br]]Group permission was restricted to read only in order to prevent the possibility that compromised member accounts could inject malicious code in to plugins or modify the log. 
     75 ''umask `027` grants full access to `uid`, read access to `gid` and prevents access from all other accounts. This should only affect the permissions of plugins installed through the Web UI and, if enabled, logs. Group permissions are restricted to read-only to prevent compromised member accounts injecting malicious code into plugins or modifying the logs.''    
     76 
    6177 
    6278== Migration from init.d script == 
    63 If you followed the old guide to make an init script, remove it: 
     79If you followed the old guide to create an init script you need to remove them: 
    6480{{{ 
    65 # sudo /etc/init.d/deluge-daemon stop 
    66 # sudo rm /etc/init.d/deluge-daemon 
    67 # sudo update-rc.d deluge-daemon remove 
     81sudo /etc/init.d/deluge-daemon stop 
     82sudo rm /etc/init.d/deluge-daemon 
     83sudo update-rc.d deluge-daemon remove 
    6884}}} 
    6985 
     
    7288=== Deluge Daemon === 
    7389{{{ 
    74 # sudo start deluged 
    75 and stopping: 
    76 # sudo stop deluged 
     90sudo start deluged 
     91}}} 
     92{{{ 
     93sudo stop deluged 
    7794}}} 
    7895 
     
    8097Although the Web UI will start/stop automatically when deluged starts/stops it can be manually controlled with: 
    8198{{{ 
    82 # sudo start deluge-web 
    83 and stopped with: 
    84 # sudo stop deluge-web 
     99sudo start deluge-web 
    85100}}} 
    86  
    87  * To prevent the web UI starting automatically comment out the `start on` line in `deluge-web.conf` by prefixing with `#`. 
     101{{{ 
     102sudo stop deluge-web 
     103}}} 
     104''Note: To prevent the web UI starting automatically comment out (# prefix) the '`start on`' line in `deluge-web.conf`.'' 
    88105 
    89106== Logging == 
    90 Create a structure for Deluge to log to and give the user that Deluge is running as (in this case deluge) full access to that directory: 
     107Create a structure for Deluge to log to and give the user that Deluge is running as (in this case `deluge`) full access to that directory: 
    91108{{{ 
    92 # sudo mkdir -p /var/log/deluge 
    93 # sudo chown -R deluge:deluge /var/log/deluge 
    94 # sudo chmod -R 750 /var/log/deluge 
     109sudo mkdir -p /var/log/deluge 
     110sudo chown -R deluge:deluge /var/log/deluge 
     111sudo chmod -R 750 /var/log/deluge 
    95112}}} 
    96  * Note: The previous commands affect the log directory and all files within it.[[br]]However, as already mentioned, the umask specified in the upstart jobs at the top of this page affect the permissions new logs are created with. 
    97   * 750 grants full access to the deluge user, only recurse tree and read access to members of the deluge group and prevents access from all other accounts.[[br]]Refer to [http://en.wikipedia.org/wiki/Chmod#Octal_numbers Wikipedia ] for details of possible values and their effects. 
    98  
     113 * Note: The above commands affect the log directory and all files within it, combined with the umask specified in the upstart jobs these affect the permissions new logs are created with. 
     114  * 750 grants full access to the deluge user, only recurse tree and read access to members of the deluge group and prevents access from all other accounts. [http://en.wikipedia.org/wiki/Chmod#Octal_numbers Chmod] 
    99115Edit the upstart job confs like so: 
    100116{{{ 
     
    108124Restart the daemon: 
    109125{{{ 
    110 # sudo restart deluge 
     126sudo restart deluge 
    111127}}} 
    112128 
    113 Tell logrotate to rotate the logs by putting this in /etc/logrotate.d/deluge: 
     129Create `/etc/logrotate.d/deluge` with the following code to rotate the logs: 
    114130{{{ 
    115131/var/log/deluge/*.log {