Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm using RH AS 3.0 at the moment. My intention is to automate a testing process. For this I'll need to automate the logon process and the kickoff of a few scripts.
I guess I have three questions.
1) I'm able to automatically logon as a standard user using one of RH's options but is there a way to logon automatically as root? I won't have to logon as root if #2 can be answered, but I would rather do it this way.
2) I have some proprietary programs that only run under root. I tried using the sticky bit on these but I guess that I don't understand that concept properly as they still won't run.
3) If i wanted to cascade a few scripts--after one finishes, the next one can go. Do I just list them in the /init/rc.d/local directory or is there a cleaner way?
1) If I assume that you are running these at boot since you ask about rc directories in 3 - then the scripts will run as root by default.
3) If you want them to run at boot then rc.local should be fine. If you want to make sure that command1 exists successfully before running command2 then you can use:
command1 && command2
If you only want to do it at runlevel 5 then don't use rc.local. Create a new script in init.d and symlink it as a startup script to the runlevel 5 folder.
I've tried put a script in the init.d directory with a S99 sysmlink in rc5.d. I'm not sure if that's the way to do it--besides the fact it's not working for me.
What I'm trying to kick off isn't a daemon, it's simple a stand-alone program. I just want it to automatically input a shell command with a few options and switches and it run on boot up as root.
Basically I don't think the issue is root, I think it's about how do I run a command from rc5.d in runlevel 5. The init script doesn't have a fully functional daemon.
I just want to run some commands once everything is up and running.
Much like running a batch file placed in the startup folder in Windows....
well, if you want the programs to start when your computer is finished booting (before X / GUI), you can *usually* add them (each on a separate line) to /etc/rc.d/rc.local (or wherever your version of that is located at -- theres usually a file like that where you can put in your commands, i'm not sure where that is exactly in RH. /etc/init.d/rc.d/rc.local maybe? )
Or, if you want them to start when your X / GUI loads, you can add them, one command per line, to ~/.xinitrc
Originally posted by mehesque Hey ssba thanks for the ~/.xinitrc suggestion I think that's the right direction. However, for some reason that isn't working.
It shouldn't effect anything, I'm pretty sure gnome uses .xinitrc as well. Does the file have executable permissions? Usually its 700 or 755.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.