Changes between Version 13 and Version 14 of UserGuide/Service/Upstart
- Timestamp:
- 02/11/2013 02:30:44 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UserGuide/Service/Upstart
v13 v14 8 8 9 9 {{{ 10 #sudo adduser --system --group --home /var/lib/deluge deluge10 sudo adduser --system --group --home /var/lib/deluge deluge 11 11 }}} 12 12 … … 16 16 17 17 {{{ 18 #sudo adduser <username> deluge18 sudo adduser <username> deluge 19 19 }}} 20 20 21 == Deluge Daemon (deluged) Upstart Script==21 == Deluge Daemon (deluged) Job == 22 22 23 Create the file `/etc/init/deluged.conf` with the following code and set uid and gidto the user and group you wish to run `deluged` as: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: 24 24 {{{ 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 30 description "Deluge daemon" 31 author "Deluge Team" 32 25 33 start on filesystem and stopped networking 26 34 stop on runlevel [016] … … 41 49 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. 42 50 43 == Deluge Web UI (deluge-web) Upstart Script==51 == Deluge Web UI (deluge-web) Job == 44 52 45 '''Put this in /etc/init/deluge-web.conf, remember to set uid and gid to your preference:'''53 Create the file `/etc/init/deluge-web.conf` with the following code and set `uid` and `gid` as required:''' 46 54 {{{ 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 60 description "Deluge Web UI" 61 author "Deluge Team" 62 47 63 start on started deluged 48 64 stop on stopping deluged … … 57 73 exec start-stop-daemon -S -c $uid:$gid -k $umask -x /usr/bin/deluge-web 58 74 }}} 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 61 77 62 78 == Migration from init.d script == 63 If you followed the old guide to make an init script, remove it:79 If you followed the old guide to create an init script you need to remove them: 64 80 {{{ 65 #sudo /etc/init.d/deluge-daemon stop66 #sudo rm /etc/init.d/deluge-daemon67 #sudo update-rc.d deluge-daemon remove81 sudo /etc/init.d/deluge-daemon stop 82 sudo rm /etc/init.d/deluge-daemon 83 sudo update-rc.d deluge-daemon remove 68 84 }}} 69 85 … … 72 88 === Deluge Daemon === 73 89 {{{ 74 # sudo start deluged 75 and stopping: 76 # sudo stop deluged 90 sudo start deluged 91 }}} 92 {{{ 93 sudo stop deluged 77 94 }}} 78 95 … … 80 97 Although the Web UI will start/stop automatically when deluged starts/stops it can be manually controlled with: 81 98 {{{ 82 # sudo start deluge-web 83 and stopped with: 84 # sudo stop deluge-web 99 sudo start deluge-web 85 100 }}} 86 87 * To prevent the web UI starting automatically comment out the `start on` line in `deluge-web.conf` by prefixing with `#`. 101 {{{ 102 sudo stop deluge-web 103 }}} 104 ''Note: To prevent the web UI starting automatically comment out (# prefix) the '`start on`' line in `deluge-web.conf`.'' 88 105 89 106 == 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:107 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: 91 108 {{{ 92 #sudo mkdir -p /var/log/deluge93 #sudo chown -R deluge:deluge /var/log/deluge94 #sudo chmod -R 750 /var/log/deluge109 sudo mkdir -p /var/log/deluge 110 sudo chown -R deluge:deluge /var/log/deluge 111 sudo chmod -R 750 /var/log/deluge 95 112 }}} 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] 99 115 Edit the upstart job confs like so: 100 116 {{{ … … 108 124 Restart the daemon: 109 125 {{{ 110 #sudo restart deluge126 sudo restart deluge 111 127 }}} 112 128 113 Tell logrotate to rotate the logs by putting this in /etc/logrotate.d/deluge:129 Create `/etc/logrotate.d/deluge` with the following code to rotate the logs: 114 130 {{{ 115 131 /var/log/deluge/*.log {