#!/sbin/openrc-run # Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 DAEMON="/usr/sbin/${RC_SVCNAME}" PID_DIR=${PID_DIR:-/var/run/${RC_SVCNAME}} PID_FILE=${PID_DIR}/${RC_SVCNAME}.pid USER=nobody GROUP=nobody DEFAULT_LOG_FILE="/var/log/${RC_SVCNAME}.log" DAEMON_ARGS=("-d -l ${REMOTE_INPUTD_ADDRESS} -p ${REMOTE_INPUTD_PORT} ${REMOTE_INPUTD_ARGS}") depend() { need net use netmount } checkconfig() { if [ ! -d ${PID_DIR} ]; then checkpath -q -d -o ${USER}:${GROUP} -m 0755 ${PID_DIR} || return 1 fi [ -z "${REMOTE_INPUTD_LOGFILE}" ] || DEFAULT_LOG_FILE="${REMOTE_INPUTD_LOGFILE}" } start() { checkconfig || return 1 ewarn "WARNING: Suitable for use in embedded/Android" ewarn "devices, but as there is no protection whatsoever it" ewarn "shouldn't be used outside of private/trusted networks." ebegin "Starting ${RC_SVCNAME}" start-stop-daemon --start --background --make-pidfile \ --pidfile "${PID_FILE}" --exec "${DAEMON}" \ -1 "${DEFAULT_LOG_FILE}" -- ${DAEMON_ARGS[@]} eend ${?} } stop() { ebegin "Stopping ${RC_SVCNAME}" start-stop-daemon --stop --retry=TERM/30/KILL/5 --quiet --pidfile "${PID_FILE}" eend ${?} } # vim: set ft=gentoo-init-d ts=4 :