Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Is there any way to run a program as root at log on for a RedHat 9.0 system running Gnome? I have already used the rc.local file, and it starts up the program during boot - which works fine. But I need the program to be run during logon. I'm really lost. Thanks for any help,
Jkobrien, what exactly does chmod u+s do? Just curious. Also, I do not have a ~/.login file. Is it maybe called something else in RedHat 9.0? I do have a login.defs file, but I don't think that's what you were referring to.
Keefaz, I will try your suggestion. When you put down "scottjwoodford", did you mean that literally? Or should I put "root"?
Jkobrien, what exactly does chmod u+s do? Just curious. Also, I do not have a ~/.login file. Is it maybe called something else in RedHat 9.0? I do have a login.defs file, but I don't think that's what you were referring to.
I would go with Keefaz' suggestion. It's neater and easier to track and modify later.
u+s means that whoever runs the program will have the same permissions as whoever owns the program. Type "man chmod".
You can always make a .login file if there isn't one there already - be adventurous! .login will be run, I think, regardless of which shell you use, while something like .bashrc, or .tcshrc, and so on, are shell specific.
Ok, but there's no way for me to know which user it will be logging on (there are multiple users), so can I add a line for all user's? And this may be a dumb question, but for <hostname>, do I literally enter that, or do I enter the actual hostname?
You'll have to a little reading up on this, but in /etc there are files that are read and executed for every user that logs in. I'm not clear myself on which ones are read when so, like I say, you'll have to do a little digging yourself but look at files like /etc/profile or it maybe that you can create /etc/login. The man pages and google will help you out there.
Watch out for the difference between scripts that are called at boot-up, log-on or when opening a new shell.
<hostname> means you should replace all that text (including the <>) with your actual hostname. It's a convention that's often used to indicate a placeholder (a bit like algebra) for your actual values. Square brackets [ ] are sometimes used for optional arguments.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.