Update NetBSD and OpenBSD services

This commit is contained in:
Norm 2022-07-05 07:05:09 -04:00
parent dcf1b44ce5
commit 1097c0cd3d
3 changed files with 39 additions and 39 deletions

View File

@ -1,24 +1,24 @@
#!/bin/sh
# PROVIDE: pleroma
# PROVIDE: akkoma
# REQUIRE: DAEMON pgsql
if [ -f /etc/rc.subr ]; then
. /etc/rc.subr
fi
name="pleroma"
name="akkoma"
rcvar=${name}
command="/usr/pkg/bin/elixir"
command_args="--detached -S /usr/pkg/bin/mix phx.server"
start_precmd="ulimit -n unlimited"
pidfile="/dev/null"
pleroma_chdir="${pleroma_home}/pleroma"
pleroma_env="HOME=${pleroma_home} MIX_ENV=prod"
akkoma_chdir="${akkoma_home}/akkoma"
akkoma_env="HOME=${akkoma_home} MIX_ENV=prod"
check_pidfile()
{
pid=$(pgrep -U "${pleroma_user}" /bin/beam.smp$)
pid=$(pgrep -U "${akkoma_user}" /bin/beam.smp$)
echo -n "${pid}"
}

View File

@ -0,0 +1,34 @@
#!/bin/ksh
#
# Default init file for Akkoma on OpenBSD
#
# Simple installation instructions:
# 1. Install Akkoma per wiki instructions
# 2. Place this akkomad file in /etc/rc.d
# 3. Enable and start Akkoma
# # doas rcctl enable akkomad
# # doas rcctl start akkomad
#
daemon="/usr/local/bin/elixir"
daemon_flags="--detached -S /usr/local/bin/mix phx.server"
daemon_user="_akkoma"
. /etc/rc.d/rc.subr
rc_reload=NO
pexp="phx.server"
rc_check() {
pgrep -q -U _akkoma -f "phx.server"
}
rc_start() {
${rcexec} "cd akkoma; ${daemon} ${daemon_flags}"
}
rc_stop() {
pkill -q -U _akkoma -f "phx.server"
}
rc_cmd $1

View File

@ -1,34 +0,0 @@
#!/bin/ksh
#
# Default init file for Pleroma on OpenBSD
#
# Simple installation instructions:
# 1. Install Pleroma per wiki instructions
# 2. Place this pleromad file in /etc/rc.d
# 3. Enable and start Pleroma
# # doas rcctl enable pleromad
# # doas rcctl start pleromad
#
daemon="/usr/local/bin/elixir"
daemon_flags="--detached -S /usr/local/bin/mix phx.server"
daemon_user="_pleroma"
. /etc/rc.d/rc.subr
rc_reload=NO
pexp="phx.server"
rc_check() {
pgrep -q -U _pleroma -f "phx.server"
}
rc_start() {
${rcexec} "cd pleroma; ${daemon} ${daemon_flags}"
}
rc_stop() {
pkill -q -U _pleroma -f "phx.server"
}
rc_cmd $1