Problem with getting automatically logged off during startup script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a custom rc.local file which installs some
software when it runs after the first reboot, it
deletes itself at the end so it's only run once. My
rc.local looks like this (editted for brevity):


[CODE]
#!/bin/sh
clear
echo " Post-Install Setup "
echo " "
rpm -ivh /root/mycustom.rpm
#restore original rc.local
mv -f /etc/rc.d/rc.local /etc/rc.d/rc.local_custom
cp /etc/rc.d/rc.local.orig /etc/rc.d/rc.local
echo " Install FINISHED! "
echo " Press ENTER to reboot "
read X
reboot
exit 0
[/CODE]


The script works fine and installs my rpm properly.
The only issue I have is when I leave the computer
when this runs, I get autologoffed after awhile.
Rather than coming back to see a "Press ENTER to
reboot" message awaiting my input, I only see the
console login screen (the computer is set to run level
3 BTW). The screen was cleared as well so I don't see
any output from my script. I estimate I get logged off
after 1-2 hours. I need to check the output from my
script so it's important I don't get logged off.

In addition, after I enter a login name and press
enter at the login prompt, the computer will reboot
itself as the reboot command from my rc.local script
is still waiting to be executed.

How can I turn off this autologoff feature when
running this rc.local script? 

Also when the rc.local is run, does it use the profile
of the root user? I checked the shell config files and
don't see TMOUT or autologout set. Just to be safe, I
tried adding the following lines before read X in my
rc.local script but I was still logged out:

TMOUT=0
unset autologout

Any ideas? Thanks.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux