aboutsummaryrefslogtreecommitdiff
path: root/www-apps/wger/files/wger.initd
diff options
context:
space:
mode:
Diffstat (limited to 'www-apps/wger/files/wger.initd')
-rw-r--r--www-apps/wger/files/wger.initd28
1 files changed, 28 insertions, 0 deletions
diff --git a/www-apps/wger/files/wger.initd b/www-apps/wger/files/wger.initd
new file mode 100644
index 0000000..e3988c3
--- /dev/null
+++ b/www-apps/wger/files/wger.initd
@@ -0,0 +1,28 @@
+#!/sbin/openrc-run
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+SETTINGS_FILE=${SETTINGS_FILE:-/etc/wger/settings.py}
+LISTEN_ADDR=${LISTEN_ADDR:-0.0.0.0}
+LISTEN_PORT=${LISTEN_PORT:-8000}
+
+name="wger daemon"
+description="Self hosted FLOSS fitness/workout, nutrition and weight tracker"
+
+pidfile="/run/${RC_SVCNAME}.pid"
+command="/usr/bin/python"
+command_args="-m wger start --settings-path=${SETTINGS_FILE} --address=${LISTEN_ADDR} --port=${LISTEN_PORT}"
+command_background=true
+command_user="wger:wger"
+
+output_log="/var/log/wger.log"
+error_log="/var/log/wger.log"
+
+depend() {
+ need net
+}
+
+start_pre() {
+ checkpath -d -m 0755 -o "$command_user" /var/lib/wger
+ checkpath -f -m 0644 -o "$command_user" "$output_log"
+}