Add xautologin script.

master3.3
Mike Hiretsky 13 years ago
parent a9a57a481c
commit 880b8b6578

@ -0,0 +1,48 @@
#!/bin/bash
# write pid for init.d/xdm
echo $BASHPID >/var/run/xinit.pid
# first param - autologin user
XUSER=$1
# number of virtual console
TTYNUM=$2
# rerun x session for XUSER
while true
do
# perform user profile setting up
env USER=$XUSER /bin/share/calculate/xdm/xdm --login || break
# write pam enviroment for pam_ck_connector
cat >/home/$XUSER/.pam_environment <<EOF
CKCON_DISPLAY_DEVICE=
CKCON_X11_DISPLAY_DEVICE=$TTYNUM
CKCON_X11_DISPLAY=:0
EOF
# run x session for user XUSER in background
su - $XUSER -c 'source /etc/profile
# replace xinit for startx
xinit()
{
# if file is script run it throught bash
if file $1 | grep -1 "POSIX shell script"
then
/bin/bash $*
else
$*
fi
}
# run script start xsession
source /usr/bin/startx' &
# store pid user session
SESSIONPID=$!
# registry user in utmp and wtmp
sessreg -a -l :0 $XUSER
# wait session logout
wait $SESSIONPID
# remove user from utmp and wtmp
sessreg -d -l :0 $XUSER
# perform logout scripts for user
env USER=$XUSER /bin/share/calculate/xdm/xdm --logout
done
exit 0

@ -32,6 +32,7 @@ data_files = []
var_data_files = []
data_files += [('/etc/init.d', ['data/calculate']),
('/usr/bin',['data/xautologin']),
('/usr/share/calculate/doc', ['data/handbook-en.html',
'data/handbook-ru.html']),
('/bin',['data/bashlogin'])]
@ -120,7 +121,8 @@ class cl_install_data(install_data):
install_data.run(self)
#data_file = [("/etc/init.d/calculate-2.2",0755)]
data_file = [("/etc/init.d/calculate",0755),
("/bin/bashlogin",0755)]
("/usr/bin/xautologin",0755),
("/bin/bashlogin",0755)]
fileNames = map(lambda x: os.path.split(x[0])[1], data_file)
listNames = map(lambda x: filter(lambda y: y, x[0].split("/")),
data_file)

Loading…
Cancel
Save