ssh-bridge 1.1.2: Alpine crond spool is /etc/crontabs - cp persistent master there before crond starts; remove stray /etc/crontabs/crontabs symlink

This commit is contained in:
Hermes Sysadmin committed 2026-11-20 00:46:32 +00:00
1 parent 5e9be625ec
commit 8fdd8b597a
2 files changed
+8 -3

No files matched your search

+7 -2
View File
@@ -43,13 +43,18 @@ fi
# busybox crontab(1) is not setuid, so the unprivileged bridge user cannot
# install its own crontab; create it here as root instead. The line is fixed
# forever — the script it runs lives in bridge's home and is freely editable.
# Alpine's crond spool is /etc/crontabs (in-image, not persistent), so keep
# the master copy in /data/crontabs and copy it into place on every boot.
cat > /data/crontabs/bridge <<'EOF'
* * * * * $HOME/.config/fleet/supervise.sh >/dev/null 2>&1
EOF
chown bridge:bridge /data/crontabs/bridge
chmod 600 /data/crontabs/bridge
ln -sfn /data/crontabs /var/spool/cron/crontabs
ln -sfn /data/crontabs /etc/crontabs
mkdir -p /etc/crontabs
rm -f /etc/crontabs/crontabs # stray symlink from an earlier revision
cp /data/crontabs/bridge /etc/crontabs/bridge
chown bridge:bridge /etc/crontabs/bridge
chmod 600 /etc/crontabs/bridge
crond -b -l 6 -L /data/cron.log
# --- sshd host key (generated once, kept in /data; never regenerate —