LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux 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
  Search this Thread
Old 03-18-2011, 11:01 AM   #1
sharjeel.nabi
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Rep: Reputation: 0
Unhappy Substitute of rc.local


Hey guys ,
plzz help me..
someone has told me to start the desired services at start up with script.. it should not be added to rc.local....

I searched so many keywords on google but every link gives result use rc.local. but I dont want to set it at start up with the help of rc.local.

Plllz zz gimme another susbtt solution..
Thanks

Shary
 
Old 03-18-2011, 11:18 AM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,825
Blog Entries: 1

Rep: Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221
Hi and welcome to LQ.


Quote:
Plllz zz gimme another susbtt solution.
Please use correct spelling.

Here's a link on how to manage services in Red Hat / Centos
http://www.linuxmail.info/how-to-sta...ices-centos-5/
 
Old 03-18-2011, 11:20 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,262

Rep: Reputation: 4440Reputation: 4440Reputation: 4440Reputation: 4440Reputation: 4440Reputation: 4440Reputation: 4440Reputation: 4440Reputation: 4440Reputation: 4440Reputation: 4440
Quote:
Originally Posted by sharjeel.nabi View Post
Hey guys ,
plzz help me..someone has told me to start the desired services at start up with script.. it should not be added to rc.local....

I searched so many keywords on google but every link gives result use rc.local. but I dont want to set it at start up with the help of rc.local.
Plllz zz gimme another susbtt solution..
Spell your words out, and write clearly. That text-speak garbage doesn't make anyone want to wade through your post, to try to figure out what you're asking.

And why is using rc.local bad? That's what it's there for. You don't provide any details, so we can't give you a whole lot of advice. What version/distro of Linux? What is the 'desired services' you're trying to start? Who wrote the startup script? How do you WANT it to be started?
 
Old 03-18-2011, 12:23 PM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
someone has told me to start the desired services at start up with script..
In your profile I see you use redhat.
You can use a init script to start services.
http://www.sensi.org/~alec/unix/redhat/sysvinit.html

Kind regards
 
Old 03-21-2011, 01:54 PM   #5
sharjeel.nabi
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Unhappy Yes sir!!!

Quote:
Originally Posted by TB0ne View Post
Spell your words out, and write clearly. That text-speak garbage doesn't make anyone want to wade through your post, to try to figure out what you're asking.

And why is using rc.local bad? That's what it's there for. You don't provide any details, so we can't give you a whole lot of advice. What version/distro of Linux? What is the 'desired services' you're trying to start? Who wrote the startup script? How do you WANT it to be started?



I tell you, I am working in client's company, one of asst. manager asked me this question. He didn,t give much information to me.
My question is how to start a service by a "script" that reboots the system as well as starts any service (ex. network, xinetd etc) on next reboot. But he told me not you use rc.local. I will have to give him proper answer otherwise my impression may be bad. So kindly ignore my spells, grammars etc... I will try to make it good. but now I need you people.

Thanks and Regards,
SHARY...
 
Old 03-21-2011, 02:09 PM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Sorry -- the question is not clear enough to answer meaningfully
 
Old 03-21-2011, 02:12 PM   #7
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,211

Rep: Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612
If you want to start up a service, without using rc.local, then you will have to make an init.d startup script and enable the service.

Searching google for:

Code:
example init.d startup script
will get you the necessary info.
 
Old 03-21-2011, 02:21 PM   #8
savona
Member
 
Registered: Mar 2011
Location: Bellmawr, NJ
Distribution: Red Hat / Fedora
Posts: 195

Rep: Reputation: 50
if I understand your question correctly you may be able to use start/kill scripts in the respective run level directory. For example, let's assume your server is running at runlevel 3, and the service you want to start is called newservice. If you gave us more information I could be more exact here, but....


you can put a start script in /etc/rc3.d/ for the Start and kill script.

/etc/rc3.d/S99newservice

inside this script you can have whatever command you use to start the service.

/etc/rc3.d/K99newservice

inside this script you can have whatever command you use to kill/stop the service.


Although I have NO understanding as to why you would not want to use rc.local, the above might be a workaround for you.

Good luck, and try to include a lot more detail when you ask questions and you will receive much better answers.
 
Old 03-21-2011, 08:06 PM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,411

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
If you're using a RH based system, also look at the 'service' & 'chkconfig' cmds.
http://www.linuxtopia.org/online_boo...ion/index.html
 
Old 03-21-2011, 08:21 PM   #10
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
And look at the scripts in /etc/init.d/ for specific examples.

Note, however, that the question you were asked:
Quote:
My question is how to start a service by a "script" that reboots the system as well as starts any service (ex. network, xinetd etc) on next reboot
makes a strange assumption, that is, that the script should "reboot the system." There are very few times that a Red Hat system would need to be rebooted, and starting, restarting or stopping a service is not among those things.

Are you sure that the client's manager wasn't just asking you a nonsense question to see how much you actually knew about Linux?
 
Old 03-24-2011, 09:40 AM   #11
sharjeel.nabi
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Smile

@PTrenholme:


yes brother,

I am still confused that why he asked such a nonsense question to me to how much do I know..

init.d and rc.local are much enough to do ...


I used this..

-------------------------------------------------
chkconfig sendmail(exampleservice) on <<<<chkconfig starts and stops the services at next logon.

shutdown -r now <<< then reboot the PC

--------------------------------------------------
Suppose I start the sendmail service (for example)

service sendmail start

then next logon I want (or He wants ) to start that service ON...

so I think it is enough to reply him..

I tested this.


Thank you my bratheren..
(but if there's any problem , I will again come to disturb you, now I am member of this forum...)
thanks alot as well as sorry for inconvinience..
REGARDS
SHARY..
 
  


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
What is best substitute for MS Access... glenn69 Linux - Software 1 08-14-2004 08:23 PM
dreamweaver - substitute? curmudgeon42 Linux - Software 1 06-03-2004 10:18 PM
vlock substitute? Narooze Linux - Software 4 01-05-2004 05:27 PM
Kazaa Substitute Bigun Linux - Software 17 11-24-2002 05:05 AM
MS Access Substitute bobcl Programming 5 01-21-2002 11:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:17 AM.

Main Menu
Advertisement
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.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration