2022-12-27 20:40:33 +00:00
|
|
|
#!/sbin/openrc-run
|
|
|
|
|
|
|
|
name="$RC_SVCNAME"
|
|
|
|
cfgfile="/etc/conf.d/$RC_SVCNAME.conf"
|
|
|
|
pidfile="/run/$RC_SVCNAME.pid"
|
|
|
|
working_directory="/usr/share/webapps/authentik"
|
2024-06-10 13:36:38 +00:00
|
|
|
command="/usr/bin/authentik-manage"
|
|
|
|
command_args="worker"
|
2022-12-27 20:40:33 +00:00
|
|
|
command_user="authentik"
|
|
|
|
command_group="authentik"
|
|
|
|
start_stop_daemon_args=""
|
|
|
|
command_background="yes"
|
|
|
|
output_log="/var/log/authentik/$RC_SVCNAME.log"
|
|
|
|
error_log="/var/log/authentik/$RC_SVCNAME.err"
|
|
|
|
|
|
|
|
depend() {
|
|
|
|
need redis
|
|
|
|
need postgresql
|
|
|
|
}
|
|
|
|
|
|
|
|
start_pre() {
|
|
|
|
cd "$working_directory"
|
|
|
|
checkpath --directory --owner $command_user:$command_group --mode 0775 \
|
|
|
|
/var/log/authentik \
|
|
|
|
/var/lib/authentik/certs \
|
|
|
|
/var/lib/authentik/blueprints
|
|
|
|
}
|
|
|
|
|
|
|
|
stop_pre() {
|
|
|
|
ebegin "Killing child processes"
|
|
|
|
kill $(ps -o pid= --ppid $(cat $pidfile)) || true
|
|
|
|
}
|