Files
meta-openembedded/meta-oe/dynamic-layers/perl-layer/recipes-support/rasdaemon/files/init
T
Beniamin Sandu 4f42391c3b rasdaemon: create recipe for version 0.6.5
Link with libargp on musl
Include limits.h
Add to packagegroup-meta-oe

Signed-off-by: Beniamin Sandu <beniaminsandu@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-05-14 10:43:48 -07:00

44 lines
993 B
Bash

#! /bin/sh
# /etc/init.d/rasdaemon: start rasdaemon service
. /etc/init.d/functions
# Defaults
PIDFILE=/var/run/rasdaemon.pid
BINFILE=/usr/sbin/rasdaemon
SCRIPTNAME=/etc/init.d/rasdaemon
[ -x $BINFILE ] || exit 0
case "$1" in
start)
echo -n "Starting RASdaemon services: "
if [ ! -f "$PIDFILE" ]; then
start-stop-daemon --start --quiet --exec $BINFILE -- --enable &> /dev/null
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $BINFILE -- --record
pidof $BINFILE > $PIDFILE
fi
[ -f $PIDFILE ] && echo "done." || echo "fail."
;;
stop)
echo -n "Stopping RASdaemon services: "
if [ -f "$PIDFILE" ] ; then
start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $BINFILE -- --disable &> /dev/null
killproc $BINFILE
rm $PIDFILE
fi
[ ! -f $PIDFILE ] && echo "done." || echo "fail."
;;
restart)
$0 stop
sleep 1
$0 start
;;
status)
status $BINFILE
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|status}"
exit 1
esac