LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 11-04-2003, 01:16 PM   #1
ewa8949
LQ Newbie
 
Registered: Nov 2003
Posts: 2

Rep: Reputation: 0
autologin as root in multiple distro's


I am posting this to the newbie section since I am new to Linux. Although I have almost completed reading a Linux book I can't quite figure out how to get started on my problem.

I need to write a script/program to test out a program my company is developing in Linux. When complete, the program will reboot the system. I need to stress test the program by running it, rebooting the system, running the program again and checking status. This has to support multiple linux distributions but not necessarily the GUI managers (KDE, gnome) since the program will have a silent command line option but it would be nice if i could autologin into KDE or Gnome and run the script.

Because of the memory locations the program accesses I need to run it as root. How can I setup multiple distributions of Linux so that it boots, runs the program as root, and then reboots and does the same thing over again? I need to do this for Red hat 9.0 and Suse 8.2 at the very least.

Thanks!
Eric
 
Old 11-04-2003, 01:28 PM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
Put the program to the end of the /etc/rc.local.
 
Old 11-04-2003, 01:54 PM   #3
ewa8949
LQ Newbie
 
Registered: Nov 2003
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks! This is exactly what I needed to get started. I tired this out with a simple cat /etc/rc.local > test.txt and it seems to be working. The program that I need to run and test out uses a linux driver to write to a restricted memory location which requires the user to be logged in as root. Does this run it as root or is there a way to use su and have it put in the root password automatically?

Thanks,
Eric
 
Old 11-04-2003, 01:59 PM   #4
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
The /etc/rc.local script is run as a root uid at the end of the boot sequence. If you need to do something as a different user, you can use su to change yourself to somebody else (su doesn't need password if you transform from root to otheruser (but the opposite is not true, of course)).
 
  


Reply


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Partitioning a drive for multiple distro's Ravager Linux - Newbie 23 11-02-2004 02:27 PM
Using multiple distro's on one computer sxa Linux - General 3 08-11-2004 07:17 PM
How to boot multiple distro's [B]on[/B] CD [B]from [/B] pingu Linux - Software 2 07-21-2004 10:13 AM
can i boot multiple distro's alongside XP? LinuxWannaBE916 Linux - Newbie 7 03-30-2004 02:22 PM
Partitioning for Multiple Distro's perrymans Linux - Newbie 4 04-15-2003 01:04 PM


All times are GMT -5. The time now is 07:24 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration