home · contact · privacy
Fixes.
authorChristian Heller <c.heller@plomlompom.de>
Wed, 1 Oct 2025 05:25:04 +0000 (07:25 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 1 Oct 2025 05:25:04 +0000 (07:25 +0200)
trixie/copy/ircplom/etc/systemd/system/ircplom.service
trixie/copy/ircplom/home/plom/.local/bin/encrypt_ircplom_logs

index 9c6105ad0c5d503bf2a03a3bd66681f28018592d..a2beacb0ec2f67346e0fa556ccfaf5140b5d12cf 100644 (file)
@@ -6,10 +6,12 @@ After=network.target
 Type=simple
 User=plom
 WorkingDirectory=/home/plom
+# once per second check if dtach file still exists, only declare run over (and thereby re-start possible) once it doesn't
 ExecStart=/bin/sh -lc "dtach -n /tmp/dtach_ircplom && while true; do sleep 1; test ! -e /tmp/dtach_ircplom && break; done"
-ExecStop=/bin/sh -lc "rm /tmp/dtach_ircplom"
+ExecStop=/bin/sh -lc "rm -f /tmp/dtach_ircplom"
 Environment=TERM=linux
 Restart=on-success
+# leave enough time for manual intervention if need be
 RestartSec=10
 
 [Install]
index 18ef1295161f2c44040aa599c06e6486729512bb..b4f58c209441c034fda7e949bd17fb38940018f4 100755 (executable)
@@ -1,7 +1,8 @@
-#!/bin/sh
+#!/usr/bin/env dash
 set -e
-cd $(dirname "$0")
-. lib/expect_n_args
+ROOT=$(dirname "$0")
+cd "${ROOT}"
+. lib/expect_n_args.sh
 
 expect_n_args 0 0 ''
 
@@ -11,7 +12,7 @@ PATH_ENCRYPTION_KEY="${HOME}/.plomlib/encrypt_with.pub"
 
 TODAY="$(date +'%Y-%m-%d')"
 set +e
-PATHS_LOGFILES="$(ls ${PATH_LOGS}/*/*/*.log 2> /dev/null)"
+PATHS_LOGFILES=$(ls "${PATH_LOGS}"/*/*/*.log 2> /dev/null)
 set -e
 if [ -z "${PATHS_LOGFILES}" ]; then
     echo "No log files present, so nothing to do."