Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 05-17-2006, 05:02 PM   #1
Registered: Apr 2004
Distribution: Centos, Fedora
Posts: 125

Rep: Reputation: 17
How to disable auto-logout when running custom rc.local script?

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

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
exit 0

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:

unset autologout

Any ideas? Thanks.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom script for particular domain: User not found in local recepient table. dlublink Linux - Networking 5 02-04-2006 01:30 PM
auto logout sysfriend Linux - Newbie 1 12-06-2005 03:20 PM
auto running a script from command line millionknives Slackware 7 10-03-2005 10:07 PM
auto logout ziox Linux - General 1 11-21-2004 06:31 PM
problems running a perl script from rc.local bobthebuilder Linux - General 2 06-16-2003 01:22 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:40 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration