LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Add programs to startup (https://www.linuxquestions.org/questions/linux-newbie-8/add-programs-to-startup-737643/)

an_sush 07-04-2009 12:32 AM

Add programs to startup
 
What is the way to add new programs to be run at startup of the system
I want Samba server and Vuze program to be automatically started at startup and not to be started manually

also wats the way to stop/kill the already running samba server

i m on red hat 5

routers 07-04-2009 12:46 AM

simple way
add command in /etc/rc.local

another way

use chkconfig :)

jschiwal 07-04-2009 02:02 AM

You can use the chkconfig command to enable the samba service (nmbd) for the runleves you want (3 & 5), or use the system-config-services GUI tool.

For starting Vuse, if it is a gui program, it depends on which desktop you are using. Also check the program itself for an option to autostart it.

okos 07-04-2009 03:25 AM

FYI
Slackware uses /etc/rc.d/rc.local instead of /etc/rc.local. And chkconfig does not exist.

geek.ksa 07-04-2009 04:27 AM

to kill the already running samba, run the command:

ps -ef | egrep 'samba|smb' | grep -v egrep

The second column of the output should contain the PID of the running process

then, once you have it, say it was 4443, execute

kill -9 4443

This will "kill" the process

cmdln 07-04-2009 04:33 PM

The "redhat" way to configure a service to start on boot or not is to use chkconfig. If the program does not have it's own init script you can either write one yourself or just shove the command in /etc/rc.local. I think /etc/rc.local needs to return 0 for success but Im not positive.

So...
chkconfig samba on

to subsuquently start and stop a service the proper way is to use the service command which is really just a wrapper around /etc/init.d/servicename so you can use that too

service samba start
/etc/init.d/samba start

start stop and restart should be valid options for any init script.

jschiwal 07-05-2009 03:08 AM

Quote:

Originally Posted by okos (Post 3596293)
FYI
Slackware uses /etc/rc.d/rc.local instead of /etc/rc.local. And chkconfig does not exist.

Yes, but the OP is running RHEL 5.


All times are GMT -5. The time now is 04:20 AM.