watchman -> ssm

Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
Jack L. Frost 2017-07-13 16:09:42 +03:00
parent 3953df0dba
commit 2205f72a2e
71 changed files with 198 additions and 212 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
#service_respawn='true' service_respawn='true'
service_command='/usr/bin/acpid' service_command='/usr/bin/acpid'
service_args=( -f ) service_args=( -f )

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
service_respawn='true' service_respawn='true'
service_command='/usr/bin/agetty' service_command='/usr/bin/agetty'

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
#service_respawn='true' #service_respawn='true'
service_command='/usr/bin/alsactl' service_command='/usr/bin/alsactl'

View File

@ -1,5 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
service_respawn=true service_respawn=true
service_command='/usr/bin/atd' service_command=( /usr/bin/atd -f )
service_args=( -f )

18
init.d/binfmt-register Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/watchman
service_type=oneshot
service_command=( /usr/bin/true )
pre_start() {
echo '1' > /proc/sys/fs/binfmt_misc/status || return 1
if [[ -d /etc/binfmt.d ]]; then
for i in /etc/binfmt.d/*; do
cat "$i" > /proc/sys/fs/binfmt_misc/register || return 1
done
fi
}
pre_stop() {
echo '-1' > /proc/sys/fs/binfmt_misc/status || return 1
}

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
# This script is intended for Daemon mode. # This script is intended for Daemon mode.
# Modify it for your setup. # Modify it for your setup.

3
init.d/cgmanager Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env ssm
service_command='/usr/bin/cgmanager'

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
#service_respawn=true #service_respawn=true
service_command='/usr/bin/chef-client' service_command='/usr/bin/chef-client'

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
#service_respawn='true' #service_respawn='true'
service_command='/usr/bin/chronyd' service_command='/usr/bin/chronyd'

View File

@ -1,63 +1,28 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
# Two warnings: # Two warnings:
# 1) This script uses a script to run cjdroute and feed it # 1) This script uses a script to run cjdroute and feed it
# the config. It can be found in the main cjdns repo: # the config. It can be found in the main cjdns repo:
# contrib/sh/run-cjdroute.sh # contrib/sh/run-cjdroute.sh
# Or here: http://ix.io/fYT # Or here: http://ix.io/fYT
# 2) service_respawn is disabled by default because you need # 2) service_respawn is disabled by default because you need
# "noBackground":1 in cjdroute.conf for it to actually work. # "noBackground":1 in cjdroute.conf for it to actually work.
# Barely. # Barely.
unset reload unset reload
#service_respawn=true service_respawn=true
service_command='/usr/bin/run-cjdroute' service_command='/usr/bin/run-cjdroute'
cjdroute_admin_port='11234' cjdroute_admin_port='11234'
cjdroute.check_tun_module() { cjdroute.check_tun_module() {
[[ -e '/dev/net/tun' ]] || { [[ -e '/dev/net/tun' ]] || {
modprobe tun || { modprobe tun || {
watchman.err "Could not load module tun!" printf 'Could not load module tun!\n'
return 1 return 1
} }
} }
} }
start() { pre_start() {
if cjdroute.check_tun_module; then cjdroute.check_tun_module
watchman.start
fi
}
get_control_pid() {
lsof -i :"$cjdroute_admin_port" | tail -1 | cut -d ' ' -f 2
}
status() {
# Check the actual cjdroute process and not the watchdog
cjdroute_control_pid=$( get_control_pid )
counter=0
until kill -0 "$cjdroute_control_pid"; do
cjdroute_control_pid=$( get_control_pid )
(( counter >= 5 )) && {
watchman.msg "cjdroute is down"
return 1
}
(( counter++ ))
sleep 1
done
watchman.msg "cjdroute is running ($cjdroute_control_pid)"
}
stop() {
[[ "$service_respawn" == 'true' ]] && { watchman.stop; } # stopping the watchdog
# Stopping the actual s-o-b daemon that won't die properly.
cjdroute_control_pid=$( get_control_pid )
watchman.pid_check "$cjdroute_control_pid" && {
kill "$cjdroute_control_pid"
watchman.pid_wait "$cjdroute_control_pid"
}
} }

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
# Author: Alad Wenter # Author: Alad Wenter
depends dbus || return 1 depends dbus || return 1

4
init.d/cronie Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env ssm
service_command='/bin/crond'
service_args=( -n )

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
#service_respawn='true' #service_respawn='true'
service_command='/usr/bin/cupsd' service_command='/usr/bin/cupsd'

View File

@ -1,15 +1,10 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
#service_respawn=true #service_respawn=true
service_command='/usr/bin/dbus-daemon' service_command='/usr/bin/dbus-daemon'
service_args=( --system --nofork ) service_args=( --system --nofork )
service_tmpfiles=( '/run/dbus:dir' ) service_tmpfiles=( '/run/dbus:dir' )
start_pre() { pre_start() {
/usr/bin/dbus-uuidgen --ensure=/etc/machine-id /usr/bin/dbus-uuidgen --ensure=/etc/machine-id
} }
start() {
start_pre
watchman.start
}

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
# This is a script to set up the links in /dev in absence of e?(u|s?m)dev. # This is a script to set up the links in /dev in absence of e?(u|s?m)dev.
service_type='oneshot' service_type='oneshot'

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
# dhcp client daemon initscript # dhcp client daemon initscript
#service_respawn=true #service_respawn=true

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
# soft depend, OR return 1 for hard depend # soft depend, OR return 1 for hard depend
depends dnscrypt-backup depends dnscrypt-backup

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
#service_respawn='true' #service_respawn='true'
service_command='/usr/bin/dnscrypt-proxy' service_command='/usr/bin/dnscrypt-proxy'

View File

@ -1,15 +1,12 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
docker_dir='/home/docker'
#service_respawn='true' #service_respawn='true'
service_command='/usr/bin/docker' service_command=( '/usr/bin/dockerd' -s overlay2 )
service_args=( -g "$docker_dir" -d )
update() { update() {
watchman.stop && { stop && {
wget "https://get.docker.io/builds/Linux/x86_64/docker-latest" -O "$service_command" wget "https://get.docker.io/builds/Linux/x86_64/docker-latest" -O "$service_command"
} }
watchman.start start
} }

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
service_respawn=true service_respawn=true
service_command='/usr/bin/dropbear' service_command='/usr/bin/dropbear'

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
#service_respawn='true' #service_respawn='true'
service_command='/usr/bin/udevd' service_command='/usr/bin/udevd'
@ -6,12 +6,12 @@ service_command='/usr/bin/udevd'
cfg_udev_settle_timeout="${cfg_udev_settle_timeout:-60}" cfg_udev_settle_timeout="${cfg_udev_settle_timeout:-60}"
udev.populate_dev() { udev.populate_dev() {
watchman.msg "Populating /dev with udev..." printf 'Populating /dev with udev...\n'
udevadm trigger --type=subsystems --action=add udevadm trigger --type=subsystems --action=add
udevadm trigger --type=devices --action=add udevadm trigger --type=devices --action=add
watchman.msg "Waiting for uevents..." printf 'Waiting for uevents...\n'
udevadm settle --timeout=${cfg_udev_settle_timeout} udevadm settle "--timeout=${cfg_udev_settle_timeout}"
udevadm control --property=do_not_run_plug_service= udevadm control --property=do_not_run_plug_service=
} }

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
# The configuration is in conf.d. # The configuration is in conf.d.
#service_respawn='true' #service_respawn='true'

View File

@ -1,14 +1,19 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
service_type='oneshot' service_type='oneshot'
service_command=( /usr/bin/fsck -A -C -p )
pre_start() {
printf 'Remounting / as read-only...\n'
mount / -o remount,ro
}
start() { start() {
watchman.msg "Remounting / as read-only..." printf 'Checking filesystems...\n'
mount / -o remount,ro super_start
}
watchman.msg "Checking filesystems..." post_start() {
/usr/bin/fsck -A -C -p printf 'Remounting / as read-write...\n'
watchman.msg "Remounting / as read-write..."
mount / -o remount,rw mount / -o remount,rw
} }

5
init.d/haproxy Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env ssm
#service_respawn=true
service_command='/usr/bin/haproxy'
service_args=( -db -f /etc/haproxy/haproxy.cfg )

4
init.d/haveged Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env ssm
service_command=/usr/bin/haveged
service_args=( -F -w 1024 -v 1 )

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
# Get hostname from /etc/hostname # Get hostname from /etc/hostname
if [[ -e "/etc/hostname" ]]; then if [[ -e "/etc/hostname" ]]; then

View File

@ -1,15 +1,12 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
service_type='oneshot' service_type='oneshot'
service_command=( /usr/bin/true )
start() { pre_start() {
watchman.msg "Running module autodetect..." printf '(${service_name}) Running module autodetect...\n'
watchman.start
}
spawn() { # The Alpine Linux hwdetect script runs this twice. Apparently to make sure we get devices that appear after loading a module on the first run.
# The Alpine Linux hwdetect script runs this twice.
# Apparently to make sure we get devices that appear after loading a module on the first run.
find /sys -name modalias -type f -print0 | xargs -0 sort -u | xargs modprobe -b -a 2>/dev/null find /sys -name modalias -type f -print0 | xargs -0 sort -u | xargs modprobe -b -a 2>/dev/null
find /sys -name modalias -type f -print0 | xargs -0 sort -u | xargs modprobe -b -a 2>/dev/null find /sys -name modalias -type f -print0 | xargs -0 sort -u | xargs modprobe -b -a 2>/dev/null

View File

@ -1,13 +1,12 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
service_type='oneshot' service_type='oneshot'
cfg_ip4dump='/etc/iptables/ip4.rules' cfg_ip4dump='/etc/iptables/ip4.rules'
cfg_ip6dump='/etc/iptables/ip6.rules' cfg_ip6dump='/etc/iptables/ip6.rules'
spawn() { service_command=( /usr/bin/true )
watchman.msg "Restoring netfilter rules..."
start() {
[[ -f "$cfg_ip4dump" ]] && { [[ -f "$cfg_ip4dump" ]] && {
iptables-restore -t < "$cfg_ip4dump" || return 1 iptables-restore -t < "$cfg_ip4dump" || return 1
iptables-restore < "$cfg_ip4dump" iptables-restore < "$cfg_ip4dump"
@ -17,20 +16,22 @@ spawn() {
ip6tables-restore -t < "$cfg_ip6dump" || return 1 ip6tables-restore -t < "$cfg_ip6dump" || return 1
ip6tables-restore < "$cfg_ip6dump" ip6tables-restore < "$cfg_ip6dump"
} }
super_start
} }
stop() { stop() {
watchman.msg "Flushing netfilter rules..."
iptables-save | sed -re 's/(:[A-Z]+\s+)[A-Z]+/\1ACCEPT/g' -e '/-.+/d' | iptables-restore iptables-save | sed -re 's/(:[A-Z]+\s+)[A-Z]+/\1ACCEPT/g' -e '/-.+/d' | iptables-restore
ip6tables-save | sed -re 's/(:[A-Z]+\s+)[A-Z]+/\1ACCEPT/g' -e '/-.+/d' | ip6tables-restore ip6tables-save | sed -re 's/(:[A-Z]+\s+)[A-Z]+/\1ACCEPT/g' -e '/-.+/d' | ip6tables-restore
for i in $(iptables-save | grep -E '^\*'); do iptables -t "${i//\*/}" -X; done for i in $(iptables-save | grep -E '^\*'); do iptables -t "${i//\*/}" -X; done
for i in $(ip6tables-save | grep -E '^\*'); do ip6tables -t "${i//\*/}" -X; done for i in $(ip6tables-save | grep -E '^\*'); do ip6tables -t "${i//\*/}" -X; done
super_stop
} }
save() { save() {
watchman.msg "Saving netfilter rules..." printf 'Saving rules.\n'
/usr/bin/iptables-save > "$cfg_ip4dump"; /usr/bin/iptables-save > "$cfg_ip4dump";
/usr/bin/ip6tables-save > "$cfg_ip6dump"; /usr/bin/ip6tables-save > "$cfg_ip6dump";
} }

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
# dhcp client daemon initscript # dhcp client daemon initscript
#service_respawn=true #service_respawn=true

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
tty="${service_name##*-}" tty="${service_name##*-}"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
#service_respawn='true' #service_respawn='true'
service_command='/usr/bin/libvirtd' service_command='/usr/bin/libvirtd'

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
cfg_iface="${service_name%%.*}" cfg_iface="${service_name%%.*}"
@ -6,7 +6,7 @@ service_type='oneshot'
service_command='/usr/bin/ip' service_command='/usr/bin/ip'
service_args=( link set "$cfg_iface" up) service_args=( link set "$cfg_iface" up)
wait_for_iface() { ready() {
local iface="$1" timer='0' timeout='6' local iface="$1" timer='0' timeout='6'
until [[ "$(ip link show $iface up)" ]]; do until [[ "$(ip link show $iface up)" ]]; do
@ -15,18 +15,7 @@ wait_for_iface() {
done done
} }
start() { pre_stop() {
watchman.msg "Activating the $cfg_iface interface..."
watchman.start
wait_for_iface || {
echo "Interface $cfg_iface failed to come up!"
return 1
}
}
stop() {
watchman.msg "Deactivating the $cfg_iface interface..."
ip link set "${cfg_iface}" down ip link set "${cfg_iface}" down
watchman.stop super_stop
} }

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
#service_respawn='true' #service_respawn='true'
service_workdir='/usr' service_workdir='/usr'

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
service_type='oneshot' service_type='oneshot'
service_command='/usr/bin/mdev' service_command='/usr/bin/mdev'

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
#service_respawn=true #service_respawn=true
service_command='/usr/bin/memcached' service_command='/usr/bin/memcached'

4
init.d/motd Normal file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env ssm
service_type='oneshot'
service_command=( /usr/local/bin/update-motd )

View File

@ -1,11 +1,12 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
service_type='oneshot' service_type='oneshot'
service_command=( /usr/bin/mount -a )
spawn() { pre_start() {
[[ -w / ]] || { mount -o remount,rw /; } [[ -w / ]] || { mount -o remount,rw /; }
mount -a
swapon -a
} }
unset stop post_start() {
swapon -a
}

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
#service_respawn=true #service_respawn=true
service_command='/usr/bin/mpd' service_command='/usr/bin/mpd'

10
init.d/network Executable file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env ssm
service_type='oneshot'
service_command=( /usr/bin/znet -d up )
ifaces=( 'eth0' 'warp' )
pre_stop() {
"$service_command" "${service_args[@]}" down
}

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
service_respawn='true' service_respawn='true'
service_command='/usr/bin/ngetty' service_command='/usr/bin/ngetty'

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
# For respawn to work, set 'daemon no' in nginx.conf # For respawn to work, set 'daemon no' in nginx.conf
#service_respawn='true' #service_respawn='true'
@ -11,15 +11,12 @@ conftest() {
nginx.test_config nginx.test_config
} }
reload() { pre_reload() {
if nginx.test_config -q; then nginx.test_config || {
watchman.reload printf 'Config test failed, not reloading.\n'
else }
watchman.err "Nginx config test failed, not reloading."
return 1
fi
} }
upgrade() { upgrade() {
watchman.msg "This script has no zero-downtime upgrade support for nginx." printf 'This script has no zero-downtime upgrade support for nginx.\n'
} }

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
cfg_nrpe_config='/etc/nrpe/nrpe.cfg' cfg_nrpe_config='/etc/nrpe/nrpe.cfg'

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
#service_respawn='true' #service_respawn='true'
service_command='/usr/bin/ntpd' service_command='/usr/bin/ntpd'

View File

@ -1,4 +1,4 @@
#!/usr/bin/watchman #!/usr/bin/env ssm
service_command='/usr/bin/oidentd' service_command='/usr/bin/oidentd'
service_args=( -i ) service_args=( -i )

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
#service_respawn='true' #service_respawn='true'
service_command='/usr/bin/ntpd' service_command='/usr/bin/ntpd'

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
cfg_ovpn_instance="${service_name##*-}" cfg_ovpn_instance="${service_name##*-}"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
service_respawn='true' service_respawn='true'
service_command="/usr/sbin/openvpn" service_command="/usr/sbin/openvpn"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
service_type='oneshot' service_type='oneshot'
service_command='/usr/bin/mkdir' service_command='/usr/bin/mkdir'

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
#service_respawn='true' #service_respawn='true'
service_command='/usr/bin/php-fpm' service_command='/usr/bin/php-fpm'

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
#service_respawn='true' #service_respawn='true'
service_command='/usr/bin/preload' service_command='/usr/bin/preload'

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
privoxy_username='privoxy' privoxy_username='privoxy'
privoxy_configfile='/etc/privoxy/config' privoxy_configfile='/etc/privoxy/config'
@ -7,16 +7,6 @@ privoxy_configfile='/etc/privoxy/config'
service_command='/usr/bin/privoxy' service_command='/usr/bin/privoxy'
service_args=( --no-daemon --user "$privoxy_username" "$privoxy_configfile" ) service_args=( --no-daemon --user "$privoxy_username" "$privoxy_configfile" )
privoxy::configtest() { pre_restart() {
"$service_command" --config-test "${service_args[@]}" "$service_command" --config-test "${service_args[@]}"
} }
restart() {
privoxy::configtest || {
watchman.err "Config test failed, not restarting!"
return 1
}
watchman.stop
watchman.start
}

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
_prosodyctl='/usr/bin/prosodyctl' _prosodyctl='/usr/bin/prosodyctl'

View File

@ -1,12 +1,6 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
service_type='oneshot' service_type='oneshot'
service_command="/etc/rc.local" service_command="/etc/rc.local"
unset stop pre_start() [[ -f "/etc/rc.local" ]]
start() {
[[ -f "/etc/rc.local" ]] && {
watchman.start
}
}

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
# Author: Alad Wenter # Author: Alad Wenter
#service_respawn=true #service_respawn=true

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
#service_respawn='true' #service_respawn='true'
service_command='/usr/bin/crond' service_command='/usr/bin/crond'

7
init.d/sdhcp Executable file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env ssm
# dhcp client daemon initscript
service_style='oneshot'
service_command='/usr/bin/sdhcp'
stop() { killall sdhcp; }

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
service_type='oneshot' service_type='oneshot'
service_command='/usr/bin/smdev' service_command='/usr/bin/smdev'

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
cfg_sshd_cfgdir='/etc/ssh' cfg_sshd_cfgdir='/etc/ssh'
@ -6,6 +6,10 @@ service_respawn=true
service_command='/usr/bin/sshd' service_command='/usr/bin/sshd'
service_args=( -D -f "$cfg_sshd_cfgdir/sshd_config" ) service_args=( -D -f "$cfg_sshd_cfgdir/sshd_config" )
depends_ready=( znet )
pre_start() { pre_start() {
[[ -e "/etc/ssh/ssh_host_key" ]] || { ssh-keygen -A; } if ! [[ -e "/etc/ssh/ssh_host_key" ]]; then
ssh-keygen -A
fi
} }

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
unset reload unset reload
service_type='oneshot' service_type='oneshot'
@ -13,11 +13,3 @@ pre_start() {
service_args=( -p "${sysctl_config_files[@]}" ) service_args=( -p "${sysctl_config_files[@]}" )
} }
start() {
if ! [[ "$sysctl_config_files" ]]; then
return 0
fi
watchman.start
}

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
#service_respawn=true #service_respawn=true
service_command='/usr/bin/syslog-ng' service_command='/usr/bin/syslog-ng'

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
#service_respawn='true' #service_respawn='true'
service_command='/usr/lib/systemd/systemd-udevd' service_command='/usr/lib/systemd/systemd-udevd'
@ -6,11 +6,11 @@ service_command='/usr/lib/systemd/systemd-udevd'
cfg_udev_settle_timeout="${cfg_udev_settle_timeout:-60}" cfg_udev_settle_timeout="${cfg_udev_settle_timeout:-60}"
udev.populate_dev() { udev.populate_dev() {
watchman.msg "Populating /dev with udev..." prinft 'Populating /dev with udev...\n'
udevadm trigger --type=subsystems --action=add udevadm trigger --type=subsystems --action=add
udevadm trigger --type=devices --action=add udevadm trigger --type=devices --action=add
watchman.msg "Waiting for uevents..." printf 'Waiting for uevents...\n'
udevadm settle --timeout=${cfg_udev_settle_timeout} udevadm settle --timeout=${cfg_udev_settle_timeout}
udevadm control --property=do_not_run_plug_service= udevadm control --property=do_not_run_plug_service=
} }

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
#service_respawn=true #service_respawn=true
service_pidfile='/run/teamviewerd.pid' service_pidfile='/run/teamviewerd.pid'

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
instance="${service_name##*-}" instance="${service_name##*-}"

View File

@ -1,18 +1,11 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
#service_respawn='true' #service_respawn='true'
service_command='/usr/bin/unbound' service_command=( /usr/bin/unbound -d )
service_args=( -d )
conftest() { pre_reload() {
unbound-checkconf unbound-checkconf || {
} printf 'Configtest failed, not reloading.\n'
reload() {
if conftest; then
watchman.reload
else
watchman.err "Configtest failed, not reloading."
return 1 return 1
fi }
} }

4
init.d/userrc Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env ssm
service_type='oneshot'
service_command='/usr/bin/userrc'

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
#service_respawn='true' #service_respawn='true'
service_command='/usr/bin/vdevd' service_command='/usr/bin/vdevd'

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
#service_respawn='true' #service_respawn='true'
service_command='/usr/bin/crond' service_command='/usr/bin/crond'

5
init.d/wpa_supplicant Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env ssm
service_command='/usr/bin/wpa_supplicant'
service_config='/etc/wpa_supplicant/wpa_supplicant.conf'
service_args=( -i "${service_name##*-}" -c "$service_config" )

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
#service_respawn=true #service_respawn=true
service_command='/usr/bin/xinetd' service_command='/usr/bin/xinetd'

View File

@ -1,10 +1,10 @@
#!/usr/bin/env watchman #!/usr/bin/env ssm
service_type='oneshot' service_type='oneshot'
service_command='/usr/bin/znet' service_command=( /usr/bin/znet -d up )
service_args=( -d )
stop() { ifaces=( 'eth0' 'warp' )
"$service_command" $service_args down
watchman.stop pre_stop() {
"$service_command" "${service_args[@]}" down
} }

3
init.d/zt Normal file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env ssm
service_command="/usr/bin/zerotier-one"