LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 05-17-2006, 05:02 PM   #1
Arodef
Member
 
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):


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

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.
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:22 AM.

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