LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to add a program to linux startup?? (https://www.linuxquestions.org/questions/linux-general-1/how-to-add-a-program-to-linux-startup-683818/)

firewiz87 11-16-2008 11:53 AM

How to add a program to linux startup??
 
I need a program, Rutilt to run automatically at system statup for all users..... How can this be done?? I am using openSUSE 11.0

Thanx in advance...

rjlee 11-16-2008 01:45 PM

Not sure what you mean by "run for all users"; a command is run by one user, or you could run it repeatedly for each user.

You can run a command at start-up, as the root user, by adding it into /etc/init.d/rc.local.

You can run a command for a particular user by adding it to that user's crontab, and using "@reboot" in the time-to-run fields.

If you want every user to run the command, I would add it to crontab, and maybe modify the adduser script to add a crontab entry in case you add any new users.

Hope that helps,

—Robert J Lee

firewiz87 11-16-2008 03:12 PM

Quote:

Originally Posted by rjlee (Post 3343957)
Not sure what you mean by "run for all users"; a command is run by one user, or you could run it repeatedly for each user.

You can run a command at start-up, as the root user, by adding it into /etc/init.d/rc.local.

You can run a command for a particular user by adding it to that user's crontab, and using "@reboot" in the time-to-run fields.

If you want every user to run the command, I would add it to crontab, and maybe modify the adduser script to add a crontab entry in case you add any new users.

Hope that helps,

—Robert J Lee


By every user, i mean that the program should run irrespective of who logs in..... i d like to add that this program is a GUI program and can be run only after a user logs in....

I am completely new to linux..... what is a crontab and how do i add anything into it?? Plz help

mrclisdue 11-16-2008 03:21 PM

It would be helpful if you would clue us in as to your DE, and/or your WM, as running programs when X starts can vary accordingly.

That being said, you should be able to start rutilt (and any other program) by placing a suitable launch command in each user's .xinitrc file.
hth,

rjlee 11-20-2008 05:08 PM

If you want every user to run the command when they log in, then you can usually just add the command to /etc/X11/Xsession (note the capital letters "X").

This is a shell script, consisting mostly of functions, but you should be able to add your command near the bottom (but above any "exit" lines).

Disadvantages (compared to each user's .xinitrc file) include the fact that this script is important to the correct running of your X session, so if you break anything then you'll break your GUI (so take a backup before you add your commands, just to make sure). But Xsession has the advantage of working for all users, and only needing to edit the change in one place.

Also, users won't be able to opt out of using it (which may be good or bad).

Crontab: A table of commands run by cron (http://en.wikipedia.org/wiki/Cron). To get instructions on editing it, you can type
Code:

man cron
and for the file format, see:
Code:

man 5 crontab

firewiz87 11-21-2008 03:18 PM

Quote:

Originally Posted by mrclisdue (Post 3344039)
It would be helpful if you would clue us in as to your DE, and/or your WM, as running programs when X starts can vary accordingly.

That being said, you should be able to start rutilt (and any other program) by placing a suitable launch command in each user's .xinitrc file.
hth,

I am using KDE.....

Modifying a file for each user is not possible..... i ll give it a try anyway.....

firewiz87 11-21-2008 03:22 PM

There are so many ways to do something in linux..... no wonder i love it.....

I ll give everything a try to see which works out best.....


All times are GMT -5. The time now is 12:13 PM.