sample.initd: modernize
This commit is contained in:
parent
8c92572bed
commit
799c8d532b
27
sample.initd
27
sample.initd
|
@ -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 $?
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue