#!/sbin/openrc-run # Copyright 1999-2022 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 GUACD_HOST="${GUACD_HOST:-127.0.0.1}" GUACD_PORT="${GUACD_PORT:-4822}" GUACD_LOGLEVEL="${GUACD_LOGLEVEL:-info}" DAEMON="/usr/sbin/guacd" PIDFILE="/run/guacamole/guacd.pid" depend() { use net } start() { checkpath -q -d -m 0755 -o guacamole:guacamole /run/guacamole/ ebegin "Starting Guacamole server" start-stop-daemon --start --user guacamole:guacamole --exec "${DAEMON}" -- -p "${PIDFILE}" -b ${GUACD_HOST} -l ${GUACD_PORT} -L ${GUACD_LOGLEVEL} eend $? "Failed to start Guacamole server" } stop() { ebegin "Stopping Guacamole server" start-stop-daemon --stop --pidfile "${PIDFILE}" eend $? "Failed to stop Guacamole server" sleep 1 }