sample.initd: modernize

This commit is contained in:
Jakub Jirutka 2016-05-24 01:42:02 +02:00 committed by Natanael Copa
parent 8c92572bed
commit 799c8d532b
1 changed files with 7 additions and 20 deletions

View File

@ -1,29 +1,16 @@
#!/sbin/runscript
#!/sbin/openrc-run
# Sample init.d file for alpine linux.
name=
daemon=/usr/sbin/$name
command="/usr/sbin/$name"
command_args="$sample_opts"
command_background="yes"
start_stop_daemon_args="--user $sample_user:$sample_group"
pidfile="/run/$name.pid"
depend() {
need net
after firewall
}
start() {
ebegin "Starting ${name}"
start-stop-daemon --start --quiet \
--pidfile /var/run/${name}.pid \
--chuid ${sample_user}:${sample_group} \
--exec ${daemon} -- ${sample_opts}
eend $?
}
stop() {
ebegin "Stopping ${name}"
start-stop-daemon --stop --quiet \
--pidfile /var/run/$name.pid \
--exec ${daemon}
eend $?
}