diff --git a/init.d/devfs b/init.d/devfs index d166c80..b25176e 100755 --- a/init.d/devfs +++ b/init.d/devfs @@ -1,5 +1,4 @@ #!/usr/bin/env watchman -# As of spark-rc 1.1.5, this script is deprecated service_type='oneshot' @@ -8,7 +7,7 @@ cfg_mounts+=( '/dev/pts:devpts:noexec,nosuid,gid=5,mode=0620:/dev/pts' ) cfg_mounts+=( '/dev/mqueue:mqueue:noexec,nosuid,nodev:/dev/mqueue' ) cfg_mounts+=( 'tmpfs:tmpfs:defaults,mode=0777:/dev/shm' ) -start() { +spawn() { for m in ${cfg_mounts[@]}; do fs_dev=`echo "$m" | cut -d':' -f1` fs_type=`echo "$m" | cut -d':' -f2` diff --git a/init.d/devfs-links b/init.d/devfs-links index 1fd68e9..2317ed6 100755 --- a/init.d/devfs-links +++ b/init.d/devfs-links @@ -1,11 +1,12 @@ #!/usr/bin/env watchman # This is a script to set up the links in /dev in absence of e?(u|s?m)dev. +# Run this _after_ miscfs. service_type='oneshot' # Config moved to conf.d -start() { +spawn() { for l in "${cfg_links[@]}"; do IFS=';' read dest link <<< "$l" diff --git a/init.d/devfs-permissions b/init.d/devfs-permissions index eb41ec2..83922c3 100755 --- a/init.d/devfs-permissions +++ b/init.d/devfs-permissions @@ -1,11 +1,12 @@ #!/usr/bin/env watchman # This is a script to set up the right permissions in /dev in absence of e?(u|s?m)dev. +# Run this _after_ miscfs. service_type='oneshot' # Config moved to conf.d -start() { +spawn() { for d in "${cfg_devices[@]}"; do IFS=';' read device owner perms <<< "$d" diff --git a/init.d/eudev b/init.d/eudev index 19de506..dd9fa48 100755 --- a/init.d/eudev +++ b/init.d/eudev @@ -5,6 +5,8 @@ service_command='/usr/bin/udevd' cfg_udev_settle_timeout="${cfg_udev_settle_timeout:-60}" +depends devfs + udev.populate_dev() { watchman.msg "Populating /dev with udev..." udevadm trigger --type=subsystems --action=add diff --git a/init.d/hostname b/init.d/hostname index 823826b..dde1ce0 100755 --- a/init.d/hostname +++ b/init.d/hostname @@ -1,6 +1,5 @@ #!/usr/bin/env watchman - service_type='oneshot' service_command='hostname' service_args="$cfg_hostname" diff --git a/init.d/iptables b/init.d/iptables index 97e3ce8..a4527be 100755 --- a/init.d/iptables +++ b/init.d/iptables @@ -5,7 +5,7 @@ service_type='oneshot' cfg_ip4dump='/etc/iptables/ip4.rules' cfg_ip6dump='/etc/iptables/ip6.rules' -start() { +spawn() { watchman.msg "Restoring netfilter rules..." [[ -f "$cfg_ip4dump" ]] && { diff --git a/init.d/mdev b/init.d/mdev index 83adcc4..23ce0cb 100755 --- a/init.d/mdev +++ b/init.d/mdev @@ -1,5 +1,7 @@ #!/usr/bin/env watchman +depends devfs + service_command='/usr/local/sbin/mdev' service_rgs='-s' diff --git a/init.d/miscfs b/init.d/miscfs index 6bec271..afbe614 100755 --- a/init.d/miscfs +++ b/init.d/miscfs @@ -1,5 +1,4 @@ #!/usr/bin/env watchman -# As of spark-rc 1.1.5, this script is deprecated service_type='oneshot' @@ -7,7 +6,7 @@ cfg_mounts+=( 'proc:proc:defaults:/proc' ) cfg_mounts+=( 'run:tmpfs:defaults:/run' ) cfg_mounts+=( 'sys:sysfs:defaults:/sys' ) -start() { +spawn() { for m in ${cfg_mounts[@]}; do fs_dev=`echo "$m" | cut -d':' -f1` fs_type=`echo "$m" | cut -d':' -f2` @@ -22,8 +21,6 @@ start() { } done - touch "${cfg_rundir}/${service_name}.done" - return 0 } diff --git a/init.d/mount b/init.d/mount index 3daf518..68924bc 100755 --- a/init.d/mount +++ b/init.d/mount @@ -1,8 +1,10 @@ #!/usr/bin/env watchman +depends miscfs + service_type='oneshot' -start() { +spawn() { [[ -w / ]] || { mount -o remount,rw /; } mount -a swapon -a diff --git a/init.d/rc.local b/init.d/rc.local index cc2445c..6dc2a68 100755 --- a/init.d/rc.local +++ b/init.d/rc.local @@ -7,5 +7,7 @@ service_args='/etc/rc.local' unset stop start() { - [[ -f "/etc/rc.local" ]] && { watchman.start; } + [[ -f "/etc/rc.local" ]] && { + watchman.start + } } diff --git a/init.d/sshd b/init.d/sshd index 0a38cf1..7e0a55a 100755 --- a/init.d/sshd +++ b/init.d/sshd @@ -8,7 +8,9 @@ service_args="-D -f $cfg_sshd_cfgdir/sshd_config" sshd_genkeys() { [[ -e "/etc/ssh/ssh_host_key" ]] || { ssh-keygen -A; } - watchman.start } -start() { sshd_genkeys; } +start() { + sshd_genkeys + watchman.start +} diff --git a/init.d/sysctl b/init.d/sysctl index 10353d3..da6c4dd 100755 --- a/init.d/sysctl +++ b/init.d/sysctl @@ -14,8 +14,4 @@ service_type='oneshot' service_command='/sbin/sysctl' service_args="-p /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf" -start() { - watchman.start -} - unset restart reload diff --git a/init.d/systemd-udevd b/init.d/systemd-udevd index 3af498a..2c3ddb4 100755 --- a/init.d/systemd-udevd +++ b/init.d/systemd-udevd @@ -5,6 +5,8 @@ service_command='/usr/lib/systemd/systemd-udevd' cfg_udev_settle_timeout="${cfg_udev_settle_timeout:-60}" +depends devfs + udev.populate_dev() { watchman.msg "Populating /dev with udev..." udevadm trigger --type=subsystems --action=add