#!/sbin/openrc-run # Copyright 2023 erg_samowzbudnik # Distributed under the terms of the GNU General Public Licence v2 # Set username you want process run with. Should be your regular user USERNAME="pipi" GROUP=$(id -g ${USERNAME}) supervisor="supervise-daemon" command_args_foreground="--foreground" # Could also get dir to store pid file from XDG_RUNTIME_DIR pidfile="/run/${RC_SVCNAME}.pid" # pidfile="/run/user/${GROUP}/${RC_SVCNAME}.pid" extra_started_commands="reload" command_user="${USERNAME}:${USERNAME}" # command_user="${USER}:${GROUP}" command="python /usr/local/sbin/pi_relay.py" description="Daemon for shroombox" depend() { need localmount use logger } reload() { ebegin "Reloading ${RC_SVCNAME}configuration" start-stop-daemon --exec "$command" --signal HUP ${supervisor} "${RC_SVCNAME}" --signal HUP --pidfile "${pidfile}" eend $? }