demo / network-computer
Public
Copy of github.com/askrobots/network-computer (MIT): a desk you reach from anything. The original lives on GitHub.
GitStable demo
README: say this is a copy and where the original is
cde82c2
14 hours, 4 minutes ago
History
nc-health · 984 bytes · 18 lines
| 1 | #!/bin/sh |
| 2 | # Keep this desk's services running: anything stopped or failed (for example, |
| 3 | # after systemd gave up restarting it) is reset and started again. Run every |
| 4 | # few minutes by nc-health.timer; needs no cloud token. Logs to the journal. |
| 5 | for s in nc-xorg nc-desktop nc-audio nc-rendezvous nc-host nc-object-server nc-object-daemon nc-voice nc-object-files; do |
| 6 | systemctl cat "$s" >/dev/null 2>&1 || continue # not on this desk |
| 7 | systemctl is-enabled --quiet "$s" 2>/dev/null || continue |
| 8 | if ! systemctl is-active --quiet "$s"; then |
| 9 | echo "nc-health: $s was $(systemctl is-active "$s"), restarting" |
| 10 | systemctl reset-failed "$s" 2>/dev/null |
| 11 | systemctl restart "$s" |
| 12 | fi |
| 13 | done |
| 14 | # ~/Objects can be "active" with the mount gone (davfs2 exited): mount it again |
| 15 | if systemctl is-enabled --quiet nc-object-files 2>/dev/null && ! nc-object-files status >/dev/null 2>&1; then |
| 16 | echo "nc-health: ~/Objects was not mounted, remounting" |
| 17 | systemctl restart nc-object-files |
| 18 | fi |