* You may wish to modify the above `umask` as it applies to any files downloaded by deluged.
* 007 grants full access to the user and members of the group deluged is running as (in this case deluge) and prevents access from all other accounts.
* 022 grants full access to the user deluged is running as and only read access to other accounts.
* 000 grants full access to all accounts.
Refer to [Wikipedia](http://en.wikipedia.org/wiki/Umask#Octal_umasks) 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.
## Deluge Web UI (deluge-web) Job
Create the file `/etc/init/deluge-web.conf` with the following code and set `uid` and `gid` as required:'''
```
# deluge-web - Deluge Web UI
#
# The Web UI component of Deluge BitTorrent client, connects to deluged and
# provides a web application interface for users. Default url: http://localhost:8112
*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.*
## Migration from init.d script
If you followed the old guide to create an init script you need to remove them:
```
sudo /etc/init.d/deluge-daemon stop
sudo rm /etc/init.d/deluge-daemon
sudo update-rc.d deluge-daemon remove
```
## Starting (and stopping) Upstart Scripts
### Deluge Daemon
```
sudo start deluged
```
```
sudo stop deluged
```
### Web UI
Although the Web UI will start/stop automatically when deluged starts/stops it can be manually controlled with:
```
sudo start deluge-web
```
```
sudo stop deluge-web
```
*Note: To prevent the web UI starting automatically comment out (# prefix) the '`start on`' line in `deluge-web.conf`.*
## Logging
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:
```
sudo mkdir -p /var/log/deluge
sudo chown -R deluge:deluge /var/log/deluge
sudo chmod -R 750 /var/log/deluge
```
* 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.
* 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. [Chmod](http://en.wikipedia.org/wiki/Chmod#Octal_numbers)