commit e94ddcac44f105188565711f3371c0e2f1fa051e
parent 90fb0a4cd9ccc960e15f54f73c2abde8596609a4
Author: Jan Pobříslo <ccx@te2000.cz>
Date: Sat, 25 Jun 2022 15:31:03 +0200
Proper output redirection from log services
Diffstat:
7 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/service_scripts/alsa/finish b/service_scripts/alsa/finish
@@ -1,4 +1,6 @@
#!/command/execlineb
+fdmove -c 2 1
+
s6-envdir env
multisubstitute {
importas -i CONTAINER_NAME CONTAINER_NAME
@@ -9,4 +11,5 @@ multisubstitute {
# define CONTAINER_DATA /mnt/volumes/containers/user/${CONTAINER_USER}/${CONTAINER_NAME}
}
foreground { umount --recursive data/root }
-rm -rf ${CONTAINER_TMPFS}
+foreground { rm -rf ${CONTAINER_TMPFS} }
+s6-svc -a log # rotate the log
diff --git a/service_scripts/alsa/run b/service_scripts/alsa/run
@@ -1,6 +1,6 @@
#!/command/execlineb
-#define CONTAINER_NAME alpine-games
-#define CONTAINER_USER ccx
+fdmove -c 2 1
+
s6-envdir env
multisubstitute {
importas -i -u CONTAINER_NAME CONTAINER_NAME
diff --git a/service_scripts/generic/finish b/service_scripts/generic/finish
@@ -1,4 +1,6 @@
#!/command/execlineb
+fdmove -c 2 1
+
s6-envdir env
multisubstitute {
importas -i CONTAINER_NAME CONTAINER_NAME
diff --git a/service_scripts/sysroot/finish b/service_scripts/sysroot/finish
@@ -1,4 +1,6 @@
#!/command/execlineb
+fdmove -c 2 1
+
s6-envdir env
multisubstitute {
importas -i CONTAINER_NAME CONTAINER_NAME
diff --git a/service_scripts/sysroot/run b/service_scripts/sysroot/run
@@ -1,4 +1,6 @@
#!/command/execlineb -P
+fdmove -c 2 1
+
s6-envdir env
multisubstitute {
importas -i -u CONTAINER_NAME CONTAINER_NAME
diff --git a/service_scripts/xsession/finish b/service_scripts/xsession/finish
@@ -1,4 +1,6 @@
#!/command/execlineb
+fdmove -c 2 1
+
s6-envdir env
multisubstitute {
importas -i CONTAINER_NAME CONTAINER_NAME
@@ -17,4 +19,5 @@ foreground {
if { test -f ${CONTAINER_TMPFS}/run/uncaught-logs/current }
mv ${CONTAINER_TMPFS}/run/uncaught-logs/current data/lastlog
}
-rm -rf ${CONTAINER_TMPFS}
+foreground { rm -rf ${CONTAINER_TMPFS} }
+s6-svc -a log # rotate the log
diff --git a/service_scripts/xsession/run b/service_scripts/xsession/run
@@ -1,4 +1,6 @@
#!/command/execlineb
+fdmove -c 2 1
+
s6-envdir env
multisubstitute {
importas -i -u CONTAINER_NAME CONTAINER_NAME