summaryrefslogtreecommitdiff
path: root/other/bootstrap_daemon/README.md
blob: a63ea5de3f5426dda26956266fc347cbf13a73fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
##Instructions for Debian

For security reasons we run the daemon under its own user.
Create a new user by executing the following:
```sh
sudo useradd --system --shell /sbin/nologin --comment "Account to run Tox's DHT bootstrap daemon" --user-group tox-bootstrapd
```

Create a directory where the daemon will store its keys:
```sh
sudo mkdir /var/lib/tox-bootstrapd/
```

Restrain other users from accessing the directory:
```sh
sudo chown tox-bootstrapd:tox-bootstrapd /var/lib/tox-bootstrapd/
sudo chmod 700 /var/lib/tox-bootstrapd/
```

Look at the variable declarations in the beginning of `tox-bootstrapd.sh` init script to see if you need to change anything for it to work for you. The default values must be fine for most users and we assume that you use those next.

Go over everything in `tox-bootstrapd.conf`. Make sure `pid_file_path` matches `PIDFILE` from `tox-bootstrapd.sh`.

Place `tox-bootstrapd.conf` file to where `CFGFILE` variable from `tox-bootstrapd` tells. By default it's `/etc/tox-bootstrapd.conf`.

Place `tox-bootstrapd.sh` init file at `/etc/init.d/tox-bootstrapd` (note the disappearance of ".sh" ending).

Set permissions for the init system to run the script:
```sh
sudo chmod 755 /etc/init.d/tox-bootstrapd
```

Make the init system aware of the script:
```sh
sudo update-rc.d tox-bootstrapd defaults
```

Start the daemon:
```sh
sudo service tox-bootstrapd start
```

Verify it's running:
```sh
sudo service tox-bootstrapd status
```

Get your public key and check that the daemon initialized correctly:
```sh
sudo grep "tox-bootstrapd" /var/log/syslog
```


###Troubleshooting:

- Check daemon's status:
```sh
sudo service tox-bootstrapd status
```

- Check the log for errors: 
```sh
sudo grep "tox-bootstrapd" /var/log/syslog
```

- Check that variables in the beginning of `/etc/init.d/tox-bootstrapd` are valid.

- Make sure `pid_file_path` in `/etc/tox-bootstrapd.conf` matches `PIDFILE` from  `/etc/init.d/tox-bootstrapd`.

- Make sure you have write permission for keys and pid files.

- Make sure you have read permission for the config file.