forked from bitlair/ansible
services/siahsd: Fix startup after reboot
This commit is contained in:
parent
04288259ca
commit
2ebc9f54e6
3 changed files with 14 additions and 4 deletions
|
@ -3,13 +3,22 @@
|
||||||
|
|
||||||
- name: Create directories
|
- name: Create directories
|
||||||
file:
|
file:
|
||||||
path: /var/log/siahsd
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: siahsd
|
owner: siahsd
|
||||||
group: nogroup
|
group: nogroup
|
||||||
with_items:
|
with_items:
|
||||||
- /var/log/siahsd
|
- /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
|
- name: Install service file
|
||||||
template:
|
template:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[siahsd]
|
[siahsd]
|
||||||
pid file = /run/siahsd/siahsd.pid
|
pid file = /var/lib/siahsd/siahsd.pid
|
||||||
log file = /var/log/siahsd/siahsd.log
|
log file = /var/log/siahsd/siahsd.log
|
||||||
log level = 3
|
log level = 3
|
||||||
foreground = 0
|
foreground = 0
|
||||||
|
|
|
@ -6,9 +6,10 @@ After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
Type=forking
|
||||||
PIDFile=/var/run/siahsd/siahsd.pid
|
PIDFile=/var/lib/siahsd/siahsd.pid
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10s
|
RestartSec=10s
|
||||||
|
ExecStartPre=-/bin/rm /var/lib/siahsd/siahsd.pid
|
||||||
ExecStart=/usr/local/src/siahsd/build/siahsd
|
ExecStart=/usr/local/src/siahsd/build/siahsd
|
||||||
User=siahsd
|
User=siahsd
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue