#!/bin/bash PID=/tmp/pid function on_exit { for p in `jobs -p`; do kill -TERM $p done rm $PID; } function on_hup { exec 2>&1 echo + reopened log file } if [ "x$1" != 'x--daemon' ]; then exec setsid $0 --daemon "$@" fi echo $$ > $PID trap on_exit EXIT trap on_hup HUP ##### MAIN ##### python /usr/share/lliurex-gnome-profile/src/session.py