#!/sbin/openrc-run # Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 UUID=${RC_SVCNAME#*.} #echo ${SVCNAME} #echo ${SVCNAME} # echo ${UUID} depend() { after bootmisc } checkconfig() { if ! blkid |grep -q ${UUID} ; then # echo "ko" eerror "UUID=${UUID} not available" return 1 else # echo "ok" my_daemo="beesd" fi } my_daemon="beesd" pidfile="/var/run/${my_daemon}.${UUID}.pid" command="/usr/sbin/${my_daemon}" command_args="${UUID}" command_log="/var/log/${my_daemon}.${UUID}.log" start() { ebegin "Starting ${SVCNAME}" checkconfig || return 1 start-stop-daemon \ --start \ --background \ --pidfile ${pidfile} \ --make-pidfile \ --exec ${command} \ -1 ${command_log} -2 ${command_log} \ -- ${command_args} eend $? } stop() { ebegin "Stopping ${my_daemon}" start-stop-daemon \ --stop \ --pidfile ${pidfile} eend $? } # vim: set ts=4 :