X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=system-status;h=3513c90863631bcc2bf20e93e6f9afaa30e7e646;hb=3c7dab4936f011bb91f42f7ccb1f8432b94ea040;hp=fc04445f02a067717b13a917ecf0ec6e187e9875;hpb=46fb17d56b093264b69cc20192603da2604111ca;p=distro-setup diff --git a/system-status b/system-status index fc04445..3513c90 100755 --- a/system-status +++ b/system-status @@ -100,6 +100,24 @@ write-status() { esac + # this section copied from servicepid() + unit=exim4 + pid=$(systemctl show --property MainPID --value $unit ||:) + case $pid in + [1-9]*) : ;; + *) + dir=/sys/fs/cgroup/system.slice + if [[ ! -d $dir ]]; then + dir=/sys/fs/cgroup/systemd/system.slice + fi; + pid=$(head -n1 $dir/${unit%.service}.service/cgroup.procs ||:) + ;; + esac + if [[ ! $pid ]]; then + chars+=(EXIM) + fi + + if [[ -e /a/bin/bash_unpublished/source-state ]]; then # /a gets remounted due to btrbk, ignore error code for file doesnt exist source /a/bin/bash_unpublished/source-state || [[ $? == 1 ]] @@ -143,7 +161,7 @@ write-status() { # allow failure in case there are no snapshots yet. # shellcheck disable=SC2012 shopt -u nullglob - files=(/mnt/root/btrbk/$vol.20*) + files=(/mnt/o/btrbk/$vol.20*) shopt -s nullglob snaps=() if (( ${#files[@]} )); then @@ -363,6 +381,9 @@ main-loop() { fi wait=15 if ! $power; then + if systemctl -q is-active bitcoind; then + bitcoinoff + fi wait=60 fi