add services

This commit is contained in:
fade 2022-08-25 19:34:01 -04:00
parent fe88a07676
commit f013670852
4 changed files with 53 additions and 8 deletions

View file

@ -0,0 +1,18 @@
#!/sbin/openrc-run
name=$RC_SVCNAME
command="/usr/bin/$name"
command_args="-config"
cfgfile="/etc/$name.json"
pidfile="/run/$name.pid"
user="nobody:nobody"
description="Mastodon group bot which reposts toots"
start() {
ebegin "Starting $name"
start-stop-daemon -bm -S -u $user -p $pidfile -x $command -- $command_args $cfgfile
eend $?
}
stop() {
ebegin "Stopping $name"
start-stop-daemon -K -p $pidfile
eend $?
}