mirror of
https://github.com/troglobit/finit.git
synced 2026-10-16 10:39:35 +00:00
Instead of having to create files, and copying them in place for each test, we move all static test files to a skeleton rootfs. This makes it a lot easier to get an overview of how things and how they work. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
52 lines
643 B
Bash
Executable File
52 lines
643 B
Bash
Executable File
#!/bin/sh
|
|
# SysV style start script for service.sh
|
|
|
|
DAEMON="/sbin/service.sh"
|
|
PIDFILE="/var/run/service.pid"
|
|
|
|
start()
|
|
{
|
|
printf 'Starting %s: ' "$DAEMON"
|
|
start-stop-daemon -S -b -q -p "$PIDFILE" -x "$DAEMON"
|
|
|
|
status=$?
|
|
if [ "$status" -eq 0 ]; then
|
|
echo "OK"
|
|
else
|
|
echo "FAIL"
|
|
fi
|
|
|
|
return "$status"
|
|
}
|
|
|
|
stop()
|
|
{
|
|
printf 'Stopping %s: ' "$DAEMON"
|
|
start-stop-daemon -K -q -p "$PIDFILE"
|
|
|
|
status=$?
|
|
if [ "$status" -eq 0 ]; then
|
|
echo "OK"
|
|
else
|
|
echo "FAIL"
|
|
fi
|
|
|
|
return "$status"
|
|
}
|
|
|
|
restart()
|
|
{
|
|
stop
|
|
sleep 1
|
|
start
|
|
}
|
|
|
|
case "$1" in
|
|
start|stop|restart)
|
|
"$1"
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart}, got $0 $1"
|
|
exit 1
|
|
esac
|