=== modified file 'sbin/runsvdirboot' --- sbin/runsvdirboot 2014-03-05 18:10:44 +0000 +++ sbin/runsvdirboot 2014-02-28 17:46:57 +0000 @@ -1,8 +1,6 @@ #!/bin/zsh -l -: ${SVDIR:=${1:-/run/service}} -export SVDIR -mkdir -p ${SVDIR} +mkdir -p ${1:-/run/service} # close filedescriptors and run runsvdir with some place to log exec <& - >& - 2>& - \ - runsvdir -P ${SVDIR} \ + runsvdir -P ${1:-/run/service} \ ${2:-................................................................................} === modified file 'sbin/zsvcheck' --- sbin/zsvcheck 2014-03-05 18:10:44 +0000 +++ sbin/zsvcheck 2014-02-28 22:45:50 +0000 @@ -7,26 +7,10 @@ zsv_parse for name in $svtab; do - zsv_eval $ZSVDIR/$name + unset "remove[$name]" + zsv_eval /run/zsv/$name zsv_dir=$zsv_svdir/$name - f=$handler[cond] - if [[ -z $f ]]; then - cond_r=N - else - (($+functions[$f])) || autoload -Uz $f - $f - cond_r=$? - fi - - f=$handler[check] - if [[ -z $f ]]; then - check_r=N - else - (($+functions[$f])) || autoload -Uz $f - $f - check_r=$? - fi - - print -r - $name: cond=$cond_r check=$check_r + $checkf + print -r - $name: $? done === modified file 'sbin/zsvgen' --- sbin/zsvgen 2014-03-05 18:10:44 +0000 +++ sbin/zsvgen 2014-03-01 15:50:09 +0000 @@ -1,8 +1,6 @@ #!/bin/zsh # vim: ft=zsh noet ts=4 sts=4 sw=4 -: ${SVDIR:=/run/service} - zparseopts -D \ h=H -help=H \ f+:=F -filter+:=F @@ -41,7 +39,7 @@ zsv_config zsv_parse -for d in $ZSVDIR/*(N/); do +for d in /run/zsv/*(N/); do if (($#service_patterns)); then for pat in $service_patterns; do if [[ $d:t == $~pat ]]; then @@ -54,7 +52,7 @@ fi done -mkdir -p ${SVDIR} +mkdir -p /run/service for name in $svtab; do unset "remove[$name]" @@ -69,7 +67,7 @@ (($pat_matches)) || continue unset pat pat_matches fi - zsv_eval $ZSVDIR/$name + zsv_eval /run/zsv/$name zsv_dir=$zsv_svdir/$name mkdir -p $zsv_dir @@ -79,7 +77,7 @@ touch $zsv_dir/down else # check if the service should be up - if $handler[cond] && ! [[ -f ${SVDIR}/down ]] ; then + if $checkf && ! [[ -f /run/service/down ]] ; then rm -f $zsv_dir/down if [[ -p $zsv_control ]]; then echo -n u > $zsv_control @@ -116,24 +114,24 @@ fi if (($link)); then - [[ -L ${SVDIR}/$name ]] && rm ${SVDIR}/$name - ln -s ../zsv/$name ${SVDIR} + [[ -L /run/service/$name ]] && rm /run/service/$name + ln -s ../zsv/$name /run/service fi done # for name in $svtab; do -# [[ -L ${SVDIR}/$name ]] && rm ${SVDIR}/$name -# ln -s ../zsv/$name ${SVDIR} +# [[ -L /run/service/$name ]] && rm /run/service/$name +# ln -s ../zsv/$name /run/service # done if (($#remove)); then - rm -f ${SVDIR}/${^remove:t} + rm -f /run/service/${^remove:t} sv_exit=( $^remove/supervise/control(N) ) (($#sv_exit)) && sv exit $sv_exit:h:h rm -rf $remove fi -broken=( ${SVDIR}/*(-@N) ) +broken=( /run/service/*(-@N) ) (($#broken)) && rm -f $broken exit 0 === modified file 'sbin/zsvwait' --- sbin/zsvwait 2014-03-05 18:10:44 +0000 +++ sbin/zsvwait 2014-02-28 18:52:35 +0000 @@ -1,8 +1,6 @@ #!/bin/zsh zmodload zsh/datetime setopt extendedglob -: ${SVDIR:=${1:-/run/service}} -export SVDIR zsvgen check_runsv() { @@ -15,7 +13,7 @@ START=$EPOCHREALTIME services_pre='' -services=( ${SVDIR}/*/run(-*) ); services=( $services:h ) +services=( /run/service/*/run(-*) ); services=( $services:h ) while [[ ${(F)services} != $services_pre ]]; do while (( $EPOCHREALTIME - $START < 10 )); do check_runsv $services && break @@ -23,5 +21,5 @@ done sv check $services services_pre="${(F)services}" - services=( ${SVDIR}/*/run(-*) ); services=( $services:h ) + services=( /run/service/*/run(-*) ); services=( $services:h ) done === modified file 'zsh-functions/zsv_config' --- zsh-functions/zsv_config 2014-03-05 18:10:44 +0000 +++ zsh-functions/zsv_config 2014-03-01 10:36:22 +0000 @@ -1,14 +1,8 @@ typeset -g -a run args zsv_hooks typeset -g -A zsv_default_handler handler zsv_hooks -if (($UID)); then - : ${ZSVDIR:=$HOME/.zsv} -else - : ${ZSVDIR:=/run/zsv} -fi - if ! (($+zsv_dir)); then - zsv_dir=$ZSVDIR/foo + zsv_dir=/run/zsv/foo fi zsv_name=$zsv_dir:t zsv_svdir=$zsv_dir:h === modified file 'zsh-functions/zsv_defaults_dhcpcd' --- zsh-functions/zsv_defaults_dhcpcd 2014-03-05 18:10:44 +0000 +++ zsh-functions/zsv_defaults_dhcpcd 2014-02-14 06:42:29 +0000 @@ -1,4 +1,2 @@ iface=${zsv_name#*.} -cond() { - zsv_check_ifup $iface -} +checkf=zsv_check_ifup === modified file 'zsh-functions/zsv_defaults_ntpd' --- zsh-functions/zsv_defaults_ntpd 2014-03-05 18:10:44 +0000 +++ zsh-functions/zsv_defaults_ntpd 2014-03-01 16:36:12 +0000 @@ -1,4 +1,4 @@ -cond() { zsv_check_route } +check() { zsv_check_route } run=( /usr/sbin/ntpd --nofork ) args=( --panicgate ) do_check() { === modified file 'zsh-functions/zsv_defaults_pppd' --- zsh-functions/zsv_defaults_pppd 2014-03-05 18:10:44 +0000 +++ zsh-functions/zsv_defaults_pppd 2014-02-18 02:46:00 +0000 @@ -3,6 +3,6 @@ run=( pppd ) if [[ -n $device ]]; then run+=( /dev/$device ) - cond() { [[ -e /dev/$device ]]; return $? } + check() { [[ -e /dev/$device ]]; return $? } fi # vim: ft=zsh noet ts=4 sts=4 sw=4 === modified file 'zsh-functions/zsv_defaults_wpa_supplicant' --- zsh-functions/zsv_defaults_wpa_supplicant 2014-03-05 18:10:44 +0000 +++ zsh-functions/zsv_defaults_wpa_supplicant 2014-03-01 15:32:18 +0000 @@ -1,5 +1,5 @@ iface=${zsv_name#*.} -cond() { zsv_check_rfkill } +check() { zsv_check_rfkill } do_check() { zsv_check_unix /var/run/wpa_supplicant/$iface } === modified file 'zsh-functions/zsv_eval' --- zsh-functions/zsv_eval 2014-03-05 18:10:44 +0000 +++ zsh-functions/zsv_eval 2014-03-03 22:57:32 +0000 @@ -18,9 +18,6 @@ #f_run=${zsv_default_runf} #f_log=${zsv_default_logf} # f_cond=check -cond() { - check -} check() { true } @@ -31,7 +28,6 @@ checkf() { handler[check]=$1 } run=( $zsv_name ) -condf cond if (($+functions[zsv_run_${zsv_name%%.*}])); then runf zsv_run_${zsv_name%%.*}