1 # Copyright (C) 2009 Andy Spencer
2 # See COPYING for terms
5 PATH=/lib/mkinit/bin:/bin:/sbin:/usr/bin:/usr/sbin
6 MKSHELL=/usr/lib/plan9/bin/rc
10 #start-test:VQPservice -u: start-foo
14 #stop-test:VQPservice -d: /
21 desktop:V: console `{echo start-^(alsa polipo spam sshd)}
22 console:V: bare `{echo start-^(at cron syslog hddtemp i8k hwclock swap)}
23 bare:V: `{echo start-^(mounts uevents hostname fsclean getty qingy localhost keymap)}
25 # Initial setup/shutdown for mkinit
26 boot:QVEPservice -u: /
28 $P mount -o remount,rw /
29 rm -f /lib/mkinit/state/*
32 # Kill all process, then remount and sync
33 halt:QVE: stop-hwclock stop-alsa
35 rm -f /lib/mkinit/state/*
37 echo TERMinating all processes
40 $P pgrep -vg0 >/dev/null && $P sleep 1
42 echo KILLing all processes
45 $P pgrep -vg0 >/dev/null && $P sleep 1
47 $P mount -o remount,ro /
50 # Proc, mtab, udev, fstab
51 start-mounts:QVPservice -u: boot
53 $P mount -t proc proc /proc
54 $P cat /proc/mounts > /etc/mtab
60 start-modules:QVEPservice -u: boot
65 # Trigger udev uevents
66 start-uevents:QVEPservice -u: start-mounts
69 $P udevadm settle '--timeout=10'
72 # Clean out /tmp and /var/run directories
73 start-fsclean:QVPservice -u: boot
79 # Spawn gettys for tty[456]
80 start-getty:QVPservice -u: start-hostname
82 $P respawn /sbin/agetty 38400 tty4 linux &
83 $P respawn /sbin/agetty 38400 tty5 linux &
84 $P respawn /sbin/agetty 38400 tty6 linux &
87 # Spawn qingys for tty[23]
88 start-qingy:QVPservice -u: start-hostname start-modules start-uevents
90 $P respawn /sbin/qingy tty2 &
91 $P respawn /sbin/qingy tty3 &
94 # Keymap (us-cc = us with ctrl-capslock switched)
95 keymap_start_cmd=loadkeys -u us-cc
98 localhost_start_cmd=ifconfig lo 127.0.0.1
99 localhost_stop_cmd=ifconfig lo down
102 hostname_start_cmd=hostname b
105 sysctl_start_cmd=sysctl -p
112 hwclock_start_cmd=hwclock --hctosys --utc
113 hwclock_stop_cmd=hwclock --systohc --utc
114 swap_start_cmd=swapon -a
115 swap_stop_cmd=swapoff -a
116 start-syslog:QVPservice -u: start-mounts
117 echo Starting syslog;
120 start-hddtemp:QVPservice -u: start-localhost
121 echo Starting hddtemp
122 $P hddtemp -d -l 127.0.0.1 /dev/sda
124 hddtemp_stop_cmd=pkill hddtemp
129 alsa_start_cmd=alsactl restore
130 alsa_stop_cmd=alsactl store
131 sshd_start_cmd=/usr/sbin/sshd
132 start-spam:QVPservice -u: start-localhost
136 start-polipo:QVPservice -u: start-localhost
140 polipo_stop_cmd=pkill polipo
145 start-%:QVPservice -u: boot
146 if (~ $#($stem^_start_cmd) 0)
149 $P $($stem^_start_cmd)
152 stop-%:QVPservice -d: /
153 if (~ $#($stem^_stop_cmd) 0)
156 $P $($stem^_stop_cmd)
159 zap-%:QVPservice -d: /