summaryrefslogtreecommitdiff
path: root/other/bootstrap_daemon/README.md
diff options
context:
space:
mode:
authorEugene Lopatin <eugene@lopatin.pw>2015-01-30 12:29:03 +0600
committerEugene Lopatin <eugene@lopatin.pw>2015-02-05 12:43:24 +0600
commit159df4b23cc3b4ce85062530e27150cef2442e4a (patch)
tree075726ed274ed23cfd973b20c5c89eda731d95cb /other/bootstrap_daemon/README.md
parentb8d530c9e0bbce331f22cbff7f818e49673d5bd7 (diff)
Documentation and service description for using tox-bootstrapd with
systemd
Diffstat (limited to 'other/bootstrap_daemon/README.md')
-rw-r--r--other/bootstrap_daemon/README.md70
1 files changed, 53 insertions, 17 deletions
diff --git a/other/bootstrap_daemon/README.md b/other/bootstrap_daemon/README.md
index 9a2dff4b..d0c16eb1 100644
--- a/other/bootstrap_daemon/README.md
+++ b/other/bootstrap_daemon/README.md
@@ -1,29 +1,32 @@
1##Instructions for Debian 1##Instructions
2
3This instruction primarily tested on Linux but, may be, will work on other POSIX-compliant systems.
2 4
3For security reasons we run the daemon under its own user. 5For security reasons we run the daemon under its own user.
6
4Create a new user by executing the following: 7Create a new user by executing the following:
5```sh 8```sh
6sudo useradd --system --shell /sbin/nologin --comment "Account to run Tox's DHT bootstrap daemon" --user-group tox-bootstrapd 9sudo useradd --home-dir /var/lib/tox-bootstrapd --create-home --system --shell /sbin/nologin --comment "Account to run Tox's DHT bootstrap daemon" --user-group tox-bootstrapd
7``` 10```
8 11
9Create a directory where the daemon will store its keys: 12Copy `tox-bootstrapd.conf` file to where `CFGFILE` variable from `tox-bootstrapd.sh` tells (for `init.d` users) or `ExecStart=` from `tox-bootstrap.service` ( for `systemd` users). By default it's `/etc/tox-bootstrapd.conf`.
10```sh 13
11sudo mkdir /var/lib/tox-bootstrapd/ 14Go over everything in `tox-bootstrapd.conf`. Make sure `pid_file_path` matches `PIDFILE` from `tox-bootstrapd.sh` (`init.d`) or `PIDFile=` from `tox-bootstrap.service` AND file in `ExecStartPre`(`systemd`).
12``` 15
13 16
14Restrain other users from accessing the directory: 17Restrict access to home directory:
15```sh 18```sh
16sudo chown tox-bootstrapd:tox-bootstrapd /var/lib/tox-bootstrapd/ 19sudo chmod 700 /var/lib/tox-bootstrapd
17sudo chmod 700 /var/lib/tox-bootstrapd/
18``` 20```
19 21
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. 22##For `init.d` users:
21
22Go over everything in `tox-bootstrapd.conf`. Make sure `pid_file_path` matches `PIDFILE` from `tox-bootstrapd.sh`.
23 23
24Place `tox-bootstrapd.conf` file to where `CFGFILE` variable from `tox-bootstrapd.sh` tells. By default it's `/etc/tox-bootstrapd.conf`. 24Look 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.
25 25
26Place `tox-bootstrapd.sh` init file at `/etc/init.d/tox-bootstrapd` (note the disappearance of ".sh" ending). 26Copy `tox-bootstrapd.sh` init file to `/etc/init.d/tox-bootstrapd` (note the disappearance of ".sh" ending).
27```sh
28sudo cp tox-bootstrapd.sh /etc/init.d/tox-bootstrapd
29```
27 30
28Set permissions for the init system to run the script: 31Set permissions for the init system to run the script:
29```sh 32```sh
@@ -50,23 +53,56 @@ Get your public key and check that the daemon initialized correctly:
50sudo grep "tox-bootstrapd" /var/log/syslog 53sudo grep "tox-bootstrapd" /var/log/syslog
51``` 54```
52 55
56##For `systemd` users:
57
58Copy tox-bootstrap.service to /etc/systemd/system/:
59```sh
60sudo cp tox-bootstrap.service /etc/systemd/system/
61```
62
63Make sure, that path to `chown` and `mkdir` is correct in `tox-bootstrap.service` (they may be different in some distributions, by default `/bin/chown` and `/bin/mkdir`)
64
65You must uncomment the next line in tox-bootstrap.service, if you want to use port number <1024
66
67 #CapabilityBoundingSet=CAP_NET_BIND_SERVICE
68
69and, possibly, install `libcap2-bin` or `libcap2` package, depending of your distribution.
70
53 71
72Reload systemd units definitions, enable service for automatic start (if needed), and start it:
73```sh
74sudo systemctl daemon-reload
75sudo systemctl enable tox-bootstrap.service
76sudo systemctl start tox-bootstrap.service
77```
54###Troubleshooting: 78###Troubleshooting:
55 79
56- Check daemon's status: 80- Check daemon's status:
57```sh 81```sh
82#init.d
58sudo service tox-bootstrapd status 83sudo service tox-bootstrapd status
84
85#systemd
86sudo systemctl status tox-bootstrap.service
59``` 87```
60 88
61- Check the log for errors: 89- Check the log for errors:
62```sh 90```sh
91#init.d
63sudo grep "tox-bootstrapd" /var/log/syslog 92sudo grep "tox-bootstrapd" /var/log/syslog
93
94#systemd
95sudo journalctl -f _SYSTEMD_UNIT=tox-bootstrap.service
64``` 96```
65 97
98`init.d`:
66- Check that variables in the beginning of `/etc/init.d/tox-bootstrapd` are valid. 99- Check that variables in the beginning of `/etc/init.d/tox-bootstrapd` are valid.
67 100
68- Make sure `pid_file_path` in `/etc/tox-bootstrapd.conf` matches `PIDFILE` from `/etc/init.d/tox-bootstrapd`.
69 101
70- Make sure you have write permission for keys and pid files. 102Common:
103
104- Make sure tox-bootstrapd user has write permission for keys and pid files (in systemd pid file insured by unit definition).
105
106- Make sure tox-bootstrapd has read permission for the config file.
71 107
72- Make sure you have read permission for the config file. 108- Make sure tox-bootstrapd location matches its path in init scripts, if you specified non-default `--prefix`, when building.