Mercurial > vanilla
view Templates/rc @ 586:1218a8f753b6
core/busybox: let's re-add /etc/inittab support
While busybox has weird /etc/inittab support the predefined actions without it
are too minimalistic so re-add the support for it but don't install an
/etc/inittab file.
The file /etc/inittab file is still installed with sysvinit but if someone wants
to use busybox's init it should create its own /etc/inittab file with the
busybox syntax and do not install sysvinit afterwards.
author | David Demelier <markand@malikania.fr> |
---|---|
date | Mon, 08 Jul 2019 20:35:00 +0200 |
parents | 030ebf8e0a69 |
children | 80faeb51a8f7 |
line wrap: on
line source
#!/bin/sh # # /etc/rc.d/template: run control script for template if [ -f /etc/rc.conf ]; then . /etc/rc.conf fi : ${TEMPLATE_CMD:=/bin/template} : ${TEMPLATE_ARGS:=--foo} : ${TEMPLATE_PID:=/var/run/template/template.pid} template_start() { echo "Starting template: $TEMPLATE_CMD $TEMPLATE_ARGS" $TEMPLATE_CMD $TEMPLATE_ARGS -p $TEMPLATE_PID } template_status() { if [ -s $TEMPLATE_PID ]; then echo "template is running with pid: `cat $TEMPLATE_PID`" else echo "template is not running" fi } template_stop() { if [ -s $TEMPLATE_PID ]; then echo "Stopping template." kill -QUIT `cat $TEMPLATE_PID` fi } template_restart() { template_stop sleep 3 template_start } case $1 in start) template_start ;; status) template_status ;; stop) template_stop ;; restart) template_restart ;; *) echo "usage: $(basename $0) restart|start|status|stop" ;; esac