3 # Copyright (C) 2009 Andy Spencer
4 # See ../COPYING for terms
14 PATH=/lib/mkinit/bin:/bin:/sbin:/usr/bin:/usr/sbin
18 echo 'usage: '$0' [options] [command]'
21 echo ' -h,--help Print usage information'
22 echo ' -t,--test Fake all commands'
23 echo ' -d,--daemon For spawning stdin listener'
26 echo ' boot Execute boot-up procedures'
27 echo ' halt Execute shutdown procedures'
28 echo ' reload Re-execute init process'
29 echo ' mk <rule> Execute mk rule'
30 echo ' start|stop|restart|zap|status <service>'
31 echo ' Start,stop,restart,zap or query status of service'
32 echo ' eval <cmd> Execute command in mkinit process'
38 tmp=`{getopt -n $0 -o htd -l help,test,daemon -- $*}
62 echo ' TESTING:' $TESTING >[2=1]
63 echo ' DAEMON:' $DAEMON >[2=1]
64 echo ' COMMAND:' $COMMAND >[2=1]
74 # Run mk on the init scripts
78 MKINIT_STATE=/tmp/mkinit_state
79 mkdir -p $MKINIT_STATE
90 echo mkinit -- running "$"cmd" "$"*"
97 if (! runamk $"*-stop)
102 case start stop zap status
111 case poweroff reboot kexec halt
126 # Run whatever was requested
129 # Fork console listener
131 while(line=`{prompt 'mkinit> '})
139 echo Respawning on /dev/console..
141 listen1 <[0]/dev/console \