To avoid conflict with plan9 rc shell we need to rename our rc. Original name come from debian invoke-rc.d, shortened into rc. Signed-off-by: Sebastien Luttringer <seblu@seblu.net> --- Makefile | 2 +- rc | 61 ------------------------------------------------------------- rc.d | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 62 deletions(-) delete mode 100755 rc create mode 100755 rc.d diff --git a/Makefile b/Makefile index d3a1824..6923840 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ install: minilogd installdirs install -m755 -t $(DESTDIR)/etc rc.local rc.local.shutdown rc.multi rc.shutdown rc.single rc.sysinit install -m755 -t $(DESTDIR)/etc/cron.hourly adjtime install -m755 -t $(DESTDIR)/etc/rc.d functions hwclock network netfs - install -m755 -t $(DESTDIR)/sbin minilogd rc + install -m755 -t $(DESTDIR)/sbin minilogd rc.d clean: rm -f minilogd minilogd.o diff --git a/rc b/rc deleted file mode 100755 index 02c2b6c..0000000 --- a/rc +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash - -. /etc/rc.conf -. /etc/rc.d/functions - -usage() { - local name=${0##*/} - cat >&2 << EOF -usage: $name action daemon ... - -e.g: $name list - $name help - $name start sshd gpm -EOF - exit 1 -} - -(( $# < 1 )) && usage - -declare -i ret=0 -case $1 in - help) - usage - ;; - list) - cd /etc/rc.d/ - for d in *; do - have_daemon "$d" || continue - # print running / stopped satus - if ! ck_daemon "$d"; then - printf "${C_OTHER}[${C_DONE}STARTED${C_OTHER}]" - else - printf "${C_OTHER}[${C_FAIL}STOPPED${C_OTHER}]" - fi - # print auto / manual status - if ! ck_autostart "$d"; then - printf "${C_OTHER}[${C_DONE}AUTO${C_OTHER}]" - else - printf "${C_OTHER}[${C_FAIL} ${C_OTHER}]" - fi - printf " ${C_CLEAR}$d\n" - done - ;; - *) - action=$1 - shift - # set same environment variables as init - runlevel=$(/sbin/runlevel) - ENV="PATH='/bin:/usr/bin:/sbin:/usr/sbin'" - ENV+=" PREVLEVEL='${runlevel:0:1}'" - ENV+=" RUNLEVEL='${runlevel:2:1}'" - ENV+=" CONSOLE='${CONSOLE:-/dev/console}'" - for i; do - [[ -x "/etc/rc.d/$i" ]] && cd / && eval /usr/bin/env -i $ENV "/etc/rc.d/$i" "$action" - (( ret += !! $? )) # clamp exit value to 0/1 - done -esac - -exit $ret - -# vim: set ts=2 sw=2 noet: diff --git a/rc.d b/rc.d new file mode 100755 index 0000000..02c2b6c --- /dev/null +++ b/rc.d @@ -0,0 +1,61 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +usage() { + local name=${0##*/} + cat >&2 << EOF +usage: $name action daemon ... + +e.g: $name list + $name help + $name start sshd gpm +EOF + exit 1 +} + +(( $# < 1 )) && usage + +declare -i ret=0 +case $1 in + help) + usage + ;; + list) + cd /etc/rc.d/ + for d in *; do + have_daemon "$d" || continue + # print running / stopped satus + if ! ck_daemon "$d"; then + printf "${C_OTHER}[${C_DONE}STARTED${C_OTHER}]" + else + printf "${C_OTHER}[${C_FAIL}STOPPED${C_OTHER}]" + fi + # print auto / manual status + if ! ck_autostart "$d"; then + printf "${C_OTHER}[${C_DONE}AUTO${C_OTHER}]" + else + printf "${C_OTHER}[${C_FAIL} ${C_OTHER}]" + fi + printf " ${C_CLEAR}$d\n" + done + ;; + *) + action=$1 + shift + # set same environment variables as init + runlevel=$(/sbin/runlevel) + ENV="PATH='/bin:/usr/bin:/sbin:/usr/sbin'" + ENV+=" PREVLEVEL='${runlevel:0:1}'" + ENV+=" RUNLEVEL='${runlevel:2:1}'" + ENV+=" CONSOLE='${CONSOLE:-/dev/console}'" + for i; do + [[ -x "/etc/rc.d/$i" ]] && cd / && eval /usr/bin/env -i $ENV "/etc/rc.d/$i" "$action" + (( ret += !! $? )) # clamp exit value to 0/1 + done +esac + +exit $ret + +# vim: set ts=2 sw=2 noet: -- Sebastien "Seblu" Luttringer