=== modified file 'README.rst' --- README.rst 2014-02-14 19:20:50 +0000 +++ README.rst 2014-02-14 16:16:45 +0000 @@ -92,7 +92,5 @@ * more checks and event listeners (eg. rfkill, dhcpcd hook) -* pluggable hooks - * export better information what and when changed in configuration of each service so they can be reloaded/restarted as needed === removed file 'zsh-functions/zsh_hook_cgroups' --- zsh-functions/zsh_hook_cgroups 2014-02-14 19:20:50 +0000 +++ zsh-functions/zsh_hook_cgroups 1970-01-01 00:00:00 +0000 @@ -1,3 +0,0 @@ -if [[ -d /sys/fs/cgroup ]]; then - zsv_hooks+=zsv_set_cgroup -fi === modified file 'zsh-functions/zsv_apply_flags' --- zsh-functions/zsv_apply_flags 2014-02-14 19:20:50 +0000 +++ zsh-functions/zsv_apply_flags 2014-02-14 07:30:20 +0000 @@ -1,3 +1,9 @@ (( ${flags[E]} )) && exec 2>&1 # stdErr (( ${flags[N]} )) && exec >/dev/null # Null +#for c in ${(s::)zsv_flags}; do +# case $c in +# ('&') exec 2>&1;; +# ('@') exec >/dev/null;; +# esac +#done # vim: ft=zsh noet ts=4 sts=4 sw=4 === modified file 'zsh-functions/zsv_check_rfkill' --- zsh-functions/zsv_check_rfkill 2014-02-14 19:20:50 +0000 +++ zsh-functions/zsv_check_rfkill 2014-02-14 05:35:03 +0000 @@ -1,7 +1,5 @@ local -a rfkill local rf -[[ -e /sys/class/net ]] || return 0 # we can't tell anything, so let it run, maybe it'll work -[[ -e /sys/class/net/$iface ]] || return 1 # no interface of such name rfkill=( /sys/class/net/$iface/*/rfkill*(N) ) for rf in $rfkill; do if [[ -e $rf/hard ]]; then @@ -11,4 +9,4 @@ (($(<$rf/soft))) || return $? fi done -return 0 # no rfkill present +return 0 === modified file 'zsh-functions/zsv_config' --- zsh-functions/zsv_config 2014-02-14 19:20:50 +0000 +++ zsh-functions/zsv_config 2014-02-14 07:23:32 +0000 @@ -1,20 +1,17 @@ -typeset -g runf logf checkf -typeset -g -a run args zsv_hooks - if ! (($+zsv_dir)); then zsv_dir=/run/zsv/foo fi zsv_name=$zsv_dir:t zsv_svdir=$zsv_dir:h - -zsv_hooks=( zsv_apply_flags ) - [[ -e /etc/zsvrc ]] && source /etc/zsvrc : ${zsv_svtab:=/etc/svtab} : ${zsv_default_flags=E} : ${zsv_default_runf=zsv_generic} : ${zsv_default_logf=zsv_logger} +typeset -g runf logf checkf +typeset -g -a run args + # autoload all zsv_ functions local -a func_files local f @@ -26,7 +23,6 @@ continue fi autoload -Uz ${f:t} - [[ $f:t == zsv_hook_* ]] && $f:t done if ! (($+commands[zsv.run])); then @@ -45,7 +41,5 @@ fi fi -(($+functions[zsv_post_hooks])) && zsv_post_hooks - [[ -n $zsv_dir ]] && zsv_setdirs # 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-02-14 19:20:50 +0000 +++ zsh-functions/zsv_defaults_wpa_supplicant 2014-02-14 06:25:10 +0000 @@ -1,2 +1,1 @@ iface=${zsv_name#*.} -check() { zsv_check_rfkill } === modified file 'zsh-functions/zsv_generic' --- zsh-functions/zsv_generic 2014-02-14 19:20:50 +0000 +++ zsh-functions/zsv_generic 2014-02-14 06:42:29 +0000 @@ -1,3 +1,5 @@ -zsv_hooks +zsv_set_cgroup +zsv_apply_flags + exec "${run[@]}" "${args[@]}" # vim: ft=zsh noet ts=4 sts=4 sw=4 === removed file 'zsh-functions/zsv_hooks' --- zsh-functions/zsv_hooks 2014-02-14 19:20:50 +0000 +++ zsh-functions/zsv_hooks 1970-01-01 00:00:00 +0000 @@ -1,5 +0,0 @@ -local hook -for hook in $zsv_hooks; do - $hook -done -# vim: ft=zsh noet ts=4 sts=4 sw=4 === removed file 'zsh-functions/zsv_run_event_reader' --- zsh-functions/zsv_run_event_reader 2014-02-14 19:20:50 +0000 +++ zsh-functions/zsv_run_event_reader 1970-01-01 00:00:00 +0000 @@ -1,8 +0,0 @@ -# read lines from command's stdout. whenever continuous block of data arrives, -# run zsvgen to update which services to run -zsv_hooks -"${run[@]}" "${args[@]}" | while read -k; do - while read -k -t; do; done - zsvgen /run/zsv.log -done -# vim: ft=zsh noet ts=4 sts=4 sw=4 === modified file 'zsh-functions/zsv_set_cgroup' --- zsh-functions/zsv_set_cgroup 2014-02-14 19:20:50 +0000 +++ zsh-functions/zsv_set_cgroup 2014-02-10 08:55:11 +0000 @@ -1,12 +1,10 @@ -if grep -q "^[^ ]* ${zsv_cgroup:h} " /proc/mounts; then - mkdir -p $zsv_cgroup && echo $$ >>$zsv_cgroup/tasks -else - # [[ -d $zsv_cgroup:h ]] && rm -rf $zsv_cgroup:h +if ! grep -q "^[^ ]* ${zsv_cgroup:h} " /proc/mounts; then + [[ -d $zsv_cgroup:h ]] && rm -rf $zsv_cgroup:h mkdir -p $zsv_cgroup:h mount -t cgroup -o cpuacct zsv $zsv_cgroup:h - if grep -q "^[^ ]* ${zsv_cgroup:h} " /proc/mounts; then - mkdir -p $zsv_cgroup && echo $$ >>$zsv_cgroup/tasks - fi fi +if grep -q "^[^ ]* ${zsv_cgroup:h} " /proc/mounts; then + mkdir -p $zsv_cgroup && echo $$ >>$zsv_cgroup/tasks +fi # vim: ft=zsh noet ts=4 sts=4 sw=4