commit e70402163f5692331189094a98bd9d9eb61fa2bc
parent b9a1c86449edc45893dfa0019c4a8f0c3bcfac04
Author: Jan Pobrislo <ccx@webprojekty.cz>
Date: Thu, 28 Jul 2022 23:18:23 +0200
Handle s6-svstat error and services not in bundles
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/command/s b/command/s
@@ -47,20 +47,22 @@ show_oneshots() {
show_longruns() {
local -a sv_stat fmt_active=( '%F{yellow}%BA%b%f' '%F{cyan}I%f' '%F{magenta}-%f' )
- local -A fmt_up=( up '%F{green}%BU%b%f' down '%F{red}D%f' starting '%F{magenta}%B?%b%f' )
+ local -A fmt_up=( up '%F{green}%BU%b%f' down '%F{red}D%f' starting '%F{magenta}%B?%b%f' err '%K{red}X%k' )
local s svcdir state active
for svcdir in /run/service/*(/); do
s=$svcdir:t
if sv_stat=( s6-svstat $svcdir ); then
state=$sv_stat[1]
[[ $state == up && $sv_stat[3] == ? ]] && state=starting
+ else
+ state=err
fi
if (($+service_type[$s])); then
active=${service_active[$s]:-2}
else
active=3
fi
- printf "%s %s\t%s\n" ${(%)fmt_up[$state]}${(%)fmt_active[$active]} $s ${(j: :)${(f)service_bundles[$s]}}
+ printf "%s %s\t%s\n" ${(%)fmt_up[$state]}${(%)fmt_active[$active]} $s ${(j: :)${(f)service_bundles[$s]:--}}
done
}