Merge branch 'debian' of https://github.com/nrgaway/core-agent-linux into debian
This commit is contained in:
commit
599fad53a2
29
debian/qubes-core-agent.postinst
vendored
29
debian/qubes-core-agent.postinst
vendored
@ -117,28 +117,33 @@ systemdInfo() {
|
|||||||
unit=${1}
|
unit=${1}
|
||||||
return_global_var=${2}
|
return_global_var=${2}
|
||||||
|
|
||||||
declare -A INFO
|
declare -A INFO=()
|
||||||
while read line; do
|
while read line; do
|
||||||
INFO[${line%%=*}]="${line##*=}"
|
INFO[${line%%=*}]="${line##*=}"
|
||||||
done < <(systemctl show ${unit} 2> /dev/null)
|
done < <(systemctl show ${unit} 2> /dev/null)
|
||||||
|
|
||||||
setArrayAsGlobal INFO $return_global_var
|
setArrayAsGlobal INFO $return_global_var
|
||||||
|
return ${#INFO[@]}
|
||||||
}
|
}
|
||||||
|
|
||||||
displayFailedStatus() {
|
displayFailedStatus() {
|
||||||
action=${1}
|
action=${1}
|
||||||
unit=${2}
|
unit=${2}
|
||||||
|
|
||||||
systemdInfo ${unit} info
|
# Only display if there are results. In chroot environmnet there will be
|
||||||
echo
|
# no results to 'systemctl show' command
|
||||||
echo "==================================================="
|
systemdInfo ${unit} info || {
|
||||||
echo "FAILED: systemd ${action} ${unit}"
|
echo
|
||||||
echo "==================================================="
|
echo "==================================================="
|
||||||
echo " LoadState = ${info[LoadState]}"
|
echo "FAILED: systemd ${action} ${unit}"
|
||||||
echo " LoadError = ${info[LoadError]}"
|
echo "==================================================="
|
||||||
echo " ActiveState = ${info[ActiveState]}"
|
echo " LoadState = ${info[LoadState]}"
|
||||||
echo " SubState = ${info[SubState]}"
|
echo " LoadError = ${info[LoadError]}"
|
||||||
echo "UnitFileState = ${info[UnitFileState]}"
|
echo " ActiveState = ${info[ActiveState]}"
|
||||||
echo
|
echo " SubState = ${info[SubState]}"
|
||||||
|
echo "UnitFileState = ${info[UnitFileState]}"
|
||||||
|
echo
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Disable systemd units
|
# Disable systemd units
|
||||||
|
Loading…
Reference in New Issue
Block a user