~修复 Docker 删除重建容器后丢失开机自启状态的问题:将 s6 自启标记持久化到 configs 卷,并在启动时通过 S6_STAGE2_HOOK 同步

This commit is contained in:
纯白色冰淇淋
2026-08-11 11:54:40 +08:00
parent 78ad72f4e4
commit d37267bceb
6 changed files with 51 additions and 4 deletions
+2 -1
View File
@@ -11,6 +11,7 @@
. "$CRASHDIR"/libs/set_config.sh
. "$CRASHDIR"/libs/set_cron.sh
. "$CRASHDIR"/libs/check_cmd.sh
. "$CRASHDIR"/libs/check_autostart.sh
. "$CRASHDIR"/libs/compare.sh
. "$CRASHDIR"/libs/logger.sh
. "$CRASHDIR"/libs/web_save.sh
@@ -54,7 +55,7 @@ start)
systemctl start shellcrash.service || . "$CRASHDIR"/starts/start_error.sh
elif grep -q 's6' /proc/1/comm; then
bfstart && /command/s6-svc -u /run/service/shellcrash && {
[ ! -f "$CRASHDIR"/.dis_startup ] && touch /etc/s6-overlay/s6-rc.d/user/contents.d/afstart
[ ! -f "$CRASHDIR"/.dis_startup ] && enable_s6_autostart_marks
afstart &
}
elif rc-status -r >/dev/null 2>&1; then