services/siahsd: Fix startup after reboot

This commit is contained in:
polyfloyd 2022-12-21 19:18:02 +01:00
parent 04288259ca
commit 2ebc9f54e6
3 changed files with 14 additions and 4 deletions

View file

@ -3,13 +3,22 @@
- name: Create directories
file:
path: /var/log/siahsd
path: "{{ item }}"
state: directory
owner: siahsd
group: nogroup
with_items:
- /var/log/siahsd
- /var/run/siahsd
- /var/lib/siahsd
- name: Install config file
template:
src: siahsd.conf
dest: /etc/siahsd.conf
owner: root
group: root
mode: 0644
notify: restart siahsd
- name: Install service file
template:

View file

@ -1,5 +1,5 @@
[siahsd]
pid file = /run/siahsd/siahsd.pid
pid file = /var/lib/siahsd/siahsd.pid
log file = /var/log/siahsd/siahsd.log
log level = 3
foreground = 0

View file

@ -6,9 +6,10 @@ After=network.target
[Service]
Type=forking
PIDFile=/var/run/siahsd/siahsd.pid
PIDFile=/var/lib/siahsd/siahsd.pid
Restart=always
RestartSec=10s
ExecStartPre=-/bin/rm /var/lib/siahsd/siahsd.pid
ExecStart=/usr/local/src/siahsd/build/siahsd
User=siahsd