LinuxQuestions.org
Have you heard the LinuxQuestions.org Podcast?
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Newbie
User Name
Password
Linux - Newbie This 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
 
Thread Tools Search this Thread
Old 07-04-2009, 01:32 AM   #1
an_sush
Member
 
Registered: Nov 2008
Posts: 46
Thanked: 0
Add programs to startup


[Log in to get rid of this advertisement]
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
an_sush is offline     Reply With Quote
Old 07-04-2009, 01:46 AM   #2
routers
Member
 
Registered: Aug 2005
Location: Malaysia - KULMY / CNXTH
Distribution: Slackware, Fedora, FreeBSD, Sun O/S 5.10, CentOS
Posts: 548
Blog Entries: 2
Thanked: 19
simple way
add command in /etc/rc.local

another way

use chkconfig
routers is offline     Reply With Quote
Old 07-04-2009, 03:02 AM   #3
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 13,312
Thanked: 294
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.

Last edited by jschiwal; 07-04-2009 at 03:21 AM..
jschiwal is offline     Reply With Quote
Old 07-04-2009, 04:25 AM   #4
okos
Member
 
Registered: May 2007
Location: California
Distribution: Slackwars 12.2
Posts: 567
Thanked: 9
FYI
Slackware uses /etc/rc.d/rc.local instead of /etc/rc.local. And chkconfig does not exist.
okos is offline     Reply With Quote
Old 07-04-2009, 05:27 AM   #5
geek.ksa
Member
 
Registered: Jan 2009
Location: Dhahran, Saudi Arabia
Distribution: RHEL 5
Posts: 40
Thanked: 4
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
geek.ksa is offline     Reply With Quote
Old 07-04-2009, 05:33 PM   #6
cmdln
Member
 
Registered: Apr 2009
Location: Lawrence, KS
Distribution: Debian, Centos
Posts: 100
Blog Entries: 1
Thanked: 15
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.
cmdln is offline     Reply With Quote
Old 07-05-2009, 04:08 AM   #7
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 13,312
Thanked: 294
Quote:
Originally Posted by okos View Post
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.
jschiwal is offline     Reply With Quote

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
How to add startup programs in Sessions? markw10 Ubuntu 2 03-11-2009 04:25 AM
Managing startup programs; removing YOU icon from startup General Suse/Novell 2 06-14-2007 09:48 PM
Mandriva startup scripts (need to add something to startup before X starts) thunderweasel Mandriva 3 01-01-2006 01:55 AM
unable to add programs from add/remove programs dav7500 Linux - Software 2 02-26-2004 08:25 PM
Cant add MySQL through add/remove programs Hero Doug Fedora 6 01-03-2004 11:35 PM


All times are GMT -5. The time now is 06:36 PM.

Main Menu
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.
Advertisement
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Click Here to receive a complimentary subscription courtesy of LQ.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration