Move systemd service file and OpenRC init script to files folder
This commit is contained in:
5
files/ddns-service-openrc.conf.d
Normal file
5
files/ddns-service-openrc.conf.d
Normal file
@@ -0,0 +1,5 @@
|
||||
#USER="ddns"
|
||||
#GROUP="ddns"
|
||||
|
||||
# Arbitrary command line arguments
|
||||
#OPTIONS=""
|
||||
22
files/ddns-service-openrc.init.d
Normal file
22
files/ddns-service-openrc.init.d
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="DDNS Service - Dynamic DNS Update Service"
|
||||
|
||||
: ${USER:=ddns}
|
||||
: ${GROUP:=ddns}
|
||||
: ${OPTIONS:=}
|
||||
|
||||
command="/usr/bin/ddns-service"
|
||||
command_args="--daemon ${OPTIONS}"
|
||||
command_user="${USER}:${GROUP}"
|
||||
command_background="yes"
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
after dns
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkpath --directory --owner ${USER}:${GROUP} --mode 0750 /var/lib/ddns-service
|
||||
}
|
||||
23
files/ddns-service.service
Normal file
23
files/ddns-service.service
Normal file
@@ -0,0 +1,23 @@
|
||||
[Unit]
|
||||
Description=DDNS Service - Dynamic DNS Update Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=ddns
|
||||
Group=ddns
|
||||
WorkingDirectory=/opt/ddns-service
|
||||
ExecStart=/usr/bin/ddns-service --daemon
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
# Security hardening
|
||||
NoNewPrivileges=yes
|
||||
ProtectSystem=strict
|
||||
ProtectHome=yes
|
||||
PrivateTmp=yes
|
||||
ReadWritePaths=/var/lib/ddns-service
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user