commit fc0f3805f356cd81a210f04a90c1294088cad349
parent 34144486b5b2dfe78d44b868178b32cc1dbb895c
Author: ccx <ccx@te2000.cz>
Date: Wed, 13 Mar 2024 21:08:15 +0000
Remove X service teardown as it's moved to ttyN/finish script
Diffstat:
1 file changed, 0 insertions(+), 46 deletions(-)
diff --git a/sbin/logincaps b/sbin/logincaps
@@ -1,7 +1,6 @@
#!/bin/zsh
setopt no_unset warn_create_global
PS4="cap $PS4"
-#set -x
trap 'printf >&2 "\nlogincaps: ALRM!\n"' ALRM
trap 'printf >&2 "\nlogincaps: HUP!\n"' HUP
@@ -9,32 +8,6 @@ trap 'printf >&2 "\nlogincaps: HUP!\n"' HUP
pretendrun() { : "$@" }
typeset -f -t pretendrun
-initialize() {
- if (($+LOGIN_TTY)); then
- mkdir -p /run/ttylock || exit $?
- touch /run/ttylock/$LOGIN_TTY:t || exit $?
- exec 3< /run/ttylock/$LOGIN_TTY:t || exit $?
- flock 3 || exit $?
- touch /run/ttylock/$LOGIN_TTY:t.cleanup || exit $?
- exec 4< /run/ttylock/$LOGIN_TTY:t.cleanup || exit $?
- flock 4 || exit $?
- if [[ $LOGIN_TTY = /dev/tty[1-4] ]]; then
- typeset -g X
- X=$[ ${LOGIN_TTY#/dev/tty} + 4 ]
- # cleanup
- nohup flock -F /run/ttylock/$LOGIN_TTY:t.cleanup \
- s6-svc -wD -d /run/service/X$X 4<& - &!
- fi
- fi
-}
-typeset -f -t initialize
-
-# cleanup() {
-# if (($+X)); then
-# s6-svc -wD -d /run/service/X$X
-# fi
-# }
-# typeset -f -t cleanup
stop_x() {
(($+X)) || return 1
@@ -56,23 +29,6 @@ run_x() {
chmod 640 /run/Xauthority.$X &&
chown xorg:$USER /run/Xauthority.$X &&
cat /run/service/X$X/data/Xauthority > /run/Xauthority.$X
-# pretendrun env XSVC=/run/service/X$X execlineb -s0 -c '
-#fdmove -c 1 2
-#redirfd -r 0 /dev/null
-#multisubstitute {
-# importas HOME HOME
-# importas USER USER
-# importas XSVC XSVC
-#}
-#ifthenelse -s { test -d $HOME } {
-# cd $HOME
-#} {
-# cd /
-#}
-# background {
-# pipeline { s6-svc -wd -c $XSVC }
-# s6-setuidgid $USER $@
-#}' "$@"
}
typeset -f -t run_x
@@ -159,6 +115,4 @@ main() {
done
}
-initialize
main
-#cleanup