LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Substitute of rc.local (https://www.linuxquestions.org/questions/linux-newbie-8/substitute-of-rc-local-869412/)

sharjeel.nabi 03-18-2011 10:01 AM

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

sycamorex 03-18-2011 10:18 AM

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/

TB0ne 03-18-2011 10:20 AM

Quote:

Originally Posted by sharjeel.nabi (Post 4295041)
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?

repo 03-18-2011 11:23 AM

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

sharjeel.nabi 03-21-2011 12:54 PM

Yes sir!!!
 
Quote:

Originally Posted by TB0ne (Post 4295057)
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...

catkin 03-21-2011 01:09 PM

Sorry -- the question is not clear enough to answer meaningfully

szboardstretcher 03-21-2011 01:12 PM

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.

savona 03-21-2011 01:21 PM

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.

chrism01 03-21-2011 07:06 PM

If you're using a RH based system, also look at the 'service' & 'chkconfig' cmds.
http://www.linuxtopia.org/online_boo...ion/index.html

PTrenholme 03-21-2011 07:21 PM

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?

sharjeel.nabi 03-24-2011 08:40 AM

@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..


All times are GMT -5. The time now is 03:37 PM.