mckaygerhard
da31ae4dc9
* to this files to work you must set: * gameid in defaults , see multicraftserver.defaults file for set the paths of this file to work in scripts daemons * log file goes to /var/log/multicraft/multicraft.log * start config file to /etc/multicraft/multicraft.conf * user to start the daemon as "multicraft" * the game group must exist, the user must be into * the shitstemd custom daemon is special, you can use as "multicraftserverNAME" and will use the config file "/e/tc/multicraft/NAME.conf" and log as "/var/log/multicraft/NAME.log" with gameid as "NAME" * sysvinit script to new file: multicraftserver.init * openrc script to new file: multicraftserver.initd * shit-stemd script to new file: multicraftserver.service * shist-stemd custom config argument daemon as new file: multicraftserver@.service * log rotate for all services as multicraftserver.logrotate * defaults starting values for scripts as multicraftserver.defaults * closes https://codeberg.org/minenux/minetest-engine-multicraft2/issues/52 * closes https://github.com/MultiCraft/MultiCraft/issues/59 * packages at https://build.opensuse.org/project/show/home:venenux:minenux
34 lines
686 B
Plaintext
34 lines
686 B
Plaintext
#!/sbin/openrc-run
|
|
|
|
description="multicraftserver daemon by MinenuX"
|
|
|
|
pidfile="/var/run/$SVCNAME.pid"
|
|
command="/usr/bin/multicraftserver"
|
|
|
|
start_stop_daemon_args="--user ${USER:-multicraft} --group ${GROUP:-games} --make-pidfile --pidfile $pidfile --background --quiet --wait 300"
|
|
command_args="$ARGS"
|
|
|
|
|
|
depend() {
|
|
need net
|
|
after firewall
|
|
}
|
|
|
|
optional_command_arg() {
|
|
if [ -n "$2" ]; then
|
|
command_args="$command_args $1 $2"
|
|
fi
|
|
}
|
|
|
|
start_pre() {
|
|
optional_command_arg --logfile $LOG
|
|
optional_command_arg --config $CONFIG
|
|
optional_command_arg --gameid $GAMEID
|
|
}
|
|
|
|
reload() {
|
|
ebegin "Reloading $SVCNAME"
|
|
start-stop-daemon --signal HUP --exec "$EXEC" --pidfile "$pidfile"
|
|
eend $?
|
|
}
|