summaryrefslogtreecommitdiff
path: root/other/bootstrap_daemon/README.md
diff options
context:
space:
mode:
authorMaxim Biro <nurupo.contributions@gmail.com>2014-08-17 01:53:54 -0400
committerMaxim Biro <nurupo.contributions@gmail.com>2014-08-17 01:53:54 -0400
commitba7058c891dbace8b90e5e2b126efee58df2ef75 (patch)
tree9eeb5c25a43197c047b98dd7ecaa9ffb5b556059 /other/bootstrap_daemon/README.md
parente474a32e716994f262a6402857626af7cab7b074 (diff)
Made possible to run the daemon under its own user
Diffstat (limited to 'other/bootstrap_daemon/README.md')
-rw-r--r--other/bootstrap_daemon/README.md84
1 files changed, 47 insertions, 37 deletions
diff --git a/other/bootstrap_daemon/README.md b/other/bootstrap_daemon/README.md
index d13c0415..ec1653d2 100644
--- a/other/bootstrap_daemon/README.md
+++ b/other/bootstrap_daemon/README.md
@@ -1,62 +1,72 @@
1##Instructions for Debian 1##Instructions for Debian
2 2
3The following commands are to be executed as root: 3For security reasons we run the daemon under its own user.
4 4Create a new user by executing the following:
51. In `tox-bootstrapd.sh` file change: 5```sh
6 - `CFG` to where your config file (`conf`) will be; read rights required 6sudo useradd --system --shell /sbin/nologin --comment "Account to run Tox's DHT bootstrap daemon" --user-group tox-bootstrapd
7 - `DAEMON` to point to the executable
8 - `PIDFILE` to point to a pid file daemon would have rights to create
9
102. Go over everything in `conf`. Make sure `pid_file_path` matches `PIDFILE` from `tox-bootstrapd.sh`
11
123. Execute:
13```
14mv tox-bootstrapd.sh /etc/init.d/tox-bootstrapd
15``` 7```
16*(note that we removed `.sh` ending)*
17 8
184. Give the right permissions to this file: 9Create a directory where the daemon will store its keys:
19``` 10```sh
20chmod 755 /etc/init.d/tox-bootstrapd 11sudo mkdir /var/lib/tox-bootstrapd/
21``` 12```
22 13
235. Execute: 14Restrain other users from accessing the directory:
24``` 15```sh
25update-rc.d tox-bootstrapd defaults 16sudo chown tox-bootstrapd:tox-bootstrapd /var/lib/tox-bootstrapd/
17sudo chmod 700 /var/lib/tox-bootstrapd/
26``` 18```
27 19
286. Start the service: 20Look 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.
29```
30service tox-bootstrapd start
31```
32 21
337. Verify that the service is running: 22Go over everything in `conf`. Make sure `pid_file_path` matches `PIDFILE` from `tox-bootstrapd.sh`.
34``` 23
35service tox-bootstrapd status 24Place `conf` file to where `CFGFILE` variable from `tox-bootstrapd` tells. By default it's `/etc/tox-bootstrapd.conf`.
25
26Place `tox-bootstrapd.sh` init file at `/etc/init.d/tox-bootstrapd`.
27
28Set permissions for the init system to run the script:
29```sh
30sudo chmod 755 /etc/init.d/tox-bootstrapd
36``` 31```
37 32
38-- 33Make the init system aware of the script:
34```sh
35sudo update-rc.d tox-bootstrapd defaults
36```
39 37
40You can see daemon's log with 38Start the daemon:
39```sh
40sudo service tox-bootstrapd start
41``` 41```
42grep "tox-bootstrapd" /var/log/syslog 42
43Verify it's running:
44```sh
45sudo service tox-bootstrapd status
43``` 46```
44 47
45**Note that system log is where you find your public key** 48Get your public key and check that the daemon initialized correctly:
49```sh
50sudo grep "tox-bootstrapd" /var/log/syslog
51```
46 52
47--
48 53
49###Troubleshooting: 54###Troubleshooting:
50 55
511. Check the log for errors with 56- Check daemon's status:
57```sh
58sudo service tox-bootstrapd status
52``` 59```
53grep "tox-bootstrapd" /var/log/syslog 60
61- Check the log for errors:
62```sh
63sudo grep "tox-bootstrapd" /var/log/syslog
54``` 64```
55 65
562. Check that paths in the beginning of `/etc/init.d/tox-bootstrapd` are valid 66- Check that variables in the beginning of `/etc/init.d/tox-bootstrapd` are valid.
57 67
583. Make sure that `PIDFILE` from `/etc/init.d/tox-bootstrapd` matches with the `pid_file_path` from `conf` 68- Make sure `pid_file_path` in `/etc/tox-bootstrapd.conf` matches `PIDFILE` from `/etc/init.d/tox-bootstrapd`.
59 69
604. Make sure you have write permission to keys and pid files 70- Make sure you have write permission for keys and pid files.
61 71
625. Make sure you have read permission for config file \ No newline at end of file 72- Make sure you have read permission for the config file. \ No newline at end of file