=== modified file 'home/xsession-setup' --- old/home/xsession-setup 2022-10-12 21:16:24 +0000 +++ new/home/xsession-setup 2022-10-12 18:48:46 +0000 @@ -1,10 +1,9 @@ #!/bin/zsh setopt no_unset extended_glob warn_create_global -typeset -g DSTROOT DISPLAYNUM REPO_ROOT +typeset -g DSTROOT DISPLAYNUM #set -x DSTROOT=$1 DISPLAYNUM=$2 -REPO_ROOT=${0:P:h:h} # make files that can't be easily version-controlled setup-special() { @@ -16,12 +15,9 @@ } copy-skel() { - local skel dst - s6-hiercopy $REPO_ROOT/xsession-skel/homedir $DSTROOT/home/$USER || exit $? - for skel in $REPO_ROOT/xsession-skel/*/*(DN); do - [[ ${skel:h:t} == homedir ]] && continue - dst=$DSTROOT/${skel:h:t}/${skel:t} - s6-hiercopy $skel $dst || exit $? + local skel + for skel in $HOME/xsession-skel/*/*(DN); do + s6-hiercopy $skel $DSTROOT/$skel:h:t/$skel:t || exit $? done } @@ -45,11 +41,6 @@ ln -f /run/user/ccx/service/pass-list/s $DSTROOT/run/pass-list.s || exit $? } -setup-init() { - ln -sf /home/$USER/run $DSTROOT/run/user-run || exit $? - ln -sf user-run/init $DSTROOT/run/init || exit $? -} - main() { if ! [[ -d $DSTROOT ]]; then echo >&2 "Destination root not a directory: $DSTROOT" @@ -66,7 +57,6 @@ setup-x11 setup-i3status setup-pass-list - setup-init } main === added directory 'xsession-skel/home' === renamed directory 'xsession-skel/homedir' => 'xsession-skel/home/ccx' === modified file 'xsession-skel/home/ccx/run/init' --- old/xsession-skel/homedir/run/init 2022-10-12 21:16:24 +0000 +++ new/xsession-skel/home/ccx/run/init 2021-03-09 11:57:40 +0000 @@ -8,9 +8,15 @@ foreground { uname -n } s6-envdir -I -- "/home/ccx/run/"/env redirfd -r 0 /dev/null +if { + if -n { test -p /run/service/s6-svscan-log/fifo } + mkfifo /run/service/s6-svscan-log/fifo +} +redirfd -wnb 1 /run/service/s6-svscan-log/fifo background { s6-setsid -- + redirfd -w 1 /run/service/s6-svscan-log/fifo fdmove -c 2 1 /home/ccx/run/rc.init } === modified file 'xsession-skel/home/ccx/run/rc.shutdown' --- old/xsession-skel/homedir/run/rc.shutdown 2022-10-12 21:16:24 +0000 +++ new/xsession-skel/home/ccx/run/rc.shutdown 2019-05-30 00:37:48 +0000 @@ -1,10 +1,26 @@ #!/bin/execlineb -P + +#redirfd -w 1 /dev/console +#fdmove -c 2 1 + foreground { s6-echo "/etc/rc.shutdown called" } +# Write a message to /var/log/syslogd + +foreground +{ + s6-ipcclient -l0 /dev/log + fdmove 1 7 + s6-echo "/etc/rc.shutdown: shutdown requested" +} + +# foreground { /sbin/openrc shutdown } + # Shut down all services + if -n { s6-rc -da change } foreground { s6-echo "`s6-rc -da change` failed" } -foreground { sleep 0.5s } +foreground { sleep 2s } === modified file 'xsession-skel/run/service/.s6-svscan/SIGQUIT' --- old/xsession-skel/run/service/.s6-svscan/SIGQUIT 2022-10-12 21:16:24 +0000 +++ new/xsession-skel/run/service/.s6-svscan/SIGQUIT 2019-05-30 00:37:48 +0000 @@ -1,4 +1,4 @@ #!/bin/execlineb -P -foreground { "/run/user-run/rc.shutdown" } +foreground { "/etc/rc.shutdown" } s6-svscanctl -q -- "/run"/service === modified file 'xsession-skel/run/service/.s6-svscan/SIGTERM' --- old/xsession-skel/run/service/.s6-svscan/SIGTERM 2022-10-12 21:16:24 +0000 +++ new/xsession-skel/run/service/.s6-svscan/SIGTERM 2019-05-30 00:37:48 +0000 @@ -1,4 +1,4 @@ #!/bin/execlineb -P -foreground { "/run/user-run/rc.shutdown" } +foreground { "/etc/rc.shutdown" } s6-svscanctl -t -- "/run"/service === modified file 'xsession-skel/run/service/.s6-svscan/SIGUSR1' --- old/xsession-skel/run/service/.s6-svscan/SIGUSR1 2022-10-12 21:16:24 +0000 +++ new/xsession-skel/run/service/.s6-svscan/SIGUSR1 2019-05-30 00:37:48 +0000 @@ -1,4 +1,4 @@ #!/bin/execlineb -P -foreground { "/run/user-run/rc.shutdown" } +foreground { "/etc/rc.shutdown" } s6-svscanctl -7 -- "/run"/service === modified file 'xsession-skel/run/service/.s6-svscan/SIGUSR2' --- old/xsession-skel/run/service/.s6-svscan/SIGUSR2 2022-10-12 21:16:24 +0000 +++ new/xsession-skel/run/service/.s6-svscan/SIGUSR2 2019-05-30 00:37:48 +0000 @@ -1,4 +1,4 @@ #!/bin/execlineb -P -foreground { "/run/user-run/rc.shutdown" } +foreground { "/etc/rc.shutdown" } s6-svscanctl -0 -- "/run"/service === modified file 'xsession-skel/run/service/.s6-svscan/finish' --- old/xsession-skel/run/service/.s6-svscan/finish 2022-10-12 21:16:24 +0000 +++ new/xsession-skel/run/service/.s6-svscan/finish 2019-05-30 00:37:48 +0000 @@ -2,8 +2,21 @@ ifelse { redirfd -w 2 /dev/null redirfd -r 0 "/run"/file\ created\ by\ s6-linux-init,\ storing\ a\ container's\ exit\ code exit 0 } { redirfd -r 0 "/run"/file\ created\ by\ s6-linux-init,\ storing\ a\ container's\ exit\ code withstdinas -in CODE foreground { s6-rmrf "/run"/file\ created\ by\ s6-linux-init,\ storing\ a\ container's\ exit\ code } importas -ui CODE CODE exit ${CODE} } - cd / +#redirfd -w 2 /dev/console +#fdmove -c 1 2 +foreground { s6-svc -X -- "/run"/service/s6-svscan-log } +unexport ? +wait -r -- { } +foreground { s6-echo "Syncing disks." } +foreground { s6-sync } foreground { s6-echo "Sending all processes the TERM signal." } foreground { s6-nuke -th } -wait -t 2000 { } +s6-sleep -m -- 2000 +foreground { s6-echo "Sending all processes the KILL signal." } +foreground { s6-nuke -k } +wait { } +foreground { s6-echo "Unmounting disks." } +foreground { s6-umount -a } +foreground { s6-mount -ro remount /dev/root / } +s6-${1} -f === modified file 'xsession-skel/run/service/check-x11-connection/run' --- old/xsession-skel/run/service/check-x11-connection/run 2022-10-12 21:16:24 +0000 +++ new/xsession-skel/run/service/check-x11-connection/run 2022-10-12 17:32:08 +0000 @@ -1,13 +1,7 @@ #!/bin/zsh setopt no_unset extended_glob -zmodload zsh/net/socket - -# pre-open this in case the file node would be ovewritten -exec 4&2 '%s\n' "FATAL: could not connect to X11 socket, terminating." - printf q >&4 - # s6-svscanctl -q /run/service + s6-svscanctl -q /run/service fi -exec cat <&3 >/dev/null +exec cat >/dev/null === added directory 'xsession-skel/run/service/s6-svscan-log' === added file 'xsession-skel/run/service/s6-svscan-log/run' --- old/xsession-skel/run/service/s6-svscan-log/run 1970-01-01 00:00:00 +0000 +++ new/xsession-skel/run/service/s6-svscan-log/run 2021-01-11 01:57:48 +0000 @@ -0,0 +1,5 @@ +#!/bin/execlineb -P +if { test -p fifo } +redirfd -rnb 0 fifo +fdblock 0 +s6-log -b -- t "/run"/uncaught-logs === added directory 'xsession-skel/run/uncaught-logs'