From f91890a06d3c10bb4239a46404ed3381dcda955b Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Wed, 22 Jun 2016 11:16:48 +0200 Subject: [PATCH] xinitrc: Use 'exec' and comment logoff cleaning issue --- .xinitrc | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.xinitrc b/.xinitrc index 67843b30..7ac907fa 100644 --- a/.xinitrc +++ b/.xinitrc @@ -1,17 +1,28 @@ #!/bin/sh +## Run site init scripts. Usually not necessary. +if [ -d /etc/X11/xinit/xinitrc.d ] ; then + for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do + [ -x "$f" ] && . "$f" + done + unset f +fi + ## Source environment config. [ -f ~/.xprofile ] && . ~/.xprofile ## Launch session -## Note: we do not 'exec' as we want to clean the session on exit. if [ $# -eq 1 ] && command -v $1 >/dev/null 2>&1; then - $1 + exec $1 else - awesome + exec awesome fi -## TODO: This is not needed since all forked processes will be killed anyway -## when 'exec' is not called. But why? +## TODO: When the session is terminated, some forked processes must be closed +## manually. This can automated by setting a shell 'trap' in .profile when +## logged from a TTY. The trick does not work from an X login manager. This file +## could be the place where to clean everything, but it will not be parsed by +## some login managers. Beside, systemd sessions may sigkill all user apps on +## logoff, preventing a clean termination. # command -v sessionclean >/dev/null 2>&1 && sessionclean