Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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?
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..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.