make scripts executable; give advice about config file permissions

master
lurchi 2018-11-05 14:45:30 +01:00
parent 117008f41f
commit cf18d12767
3 changed files with 10 additions and 2 deletions

View File

@ -21,7 +21,15 @@ sudo cp homeserverdns-daemon homeserverdns-update /usr/bin
sudo cp homeserverdns.cfg /etc
```
If we want to use systemd to control homeserverdns, we need to install the service file `homeserverdns.service`. We have to make sure that the path of the config file is correct in that file.
We create a user and adjust the permissions of the config file, so only that user can read it (and the credentials in it).
```shell
sudo useradd --system homeserverdns
sudo chown homeserverdns:root /etc/homeserverdns.cfg
sudo chown 0600 /etc/homeserverdns.cfg
```
If we want to use systemd to control homeserverdns, we need to install the service file `homeserverdns.service`. We have to make sure that the path of the config file and the `User` variable are correct in that file.
```shell
sudo cp homeserverdns.service /etc/systemd/system

0
homeserverdns-update Normal file → Executable file
View File

View File

@ -4,6 +4,6 @@ Description=DNS updater for home servers
[Service]
ExecStart=/usr/bin/env bash -c 'homeserverdns-daemon /etc/homeserverdns.cfg'
User=homeserverdns
Group=nobody
User=nobody
Type=simple