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 |
Hi and welcome to LQ.
Quote:
Here's a link on how to manage services in Red Hat / Centos http://www.linuxmail.info/how-to-sta...ices-centos-5/ |
Quote:
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? |
Quote:
You can use a init script to start services. http://www.sensi.org/~alec/unix/redhat/sysvinit.html Kind regards |
Yes sir!!!
Quote:
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... |
Sorry -- the question is not clear enough to answer meaningfully
|
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 |
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. |
If you're using a RH based system, also look at the 'service' & 'chkconfig' cmds.
http://www.linuxtopia.org/online_boo...ion/index.html |
And look at the scripts in /etc/init.d/ for specific examples.
Note, however, that the question you were asked: Quote:
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? |
@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. |