CentOS-6.2 & Upstart: Alternative to starting process with runlevel @ boot-up
CentOS release 6.2
upstart-0.6.5-10.el6.x86_64 Can anyone recommend an alternative event to runlevel change when auto-starting a process at boot up? I've written the following upstart script to respawn a process after reboot (and gracefully shutdown before system shutdown/reboot). It seems to work fine (though please let me know if you recommend any improvements). Quote:
#start on started networking #start on startup #start on (local-filesystems) #start on started net-device-up IFACE=lo #start on started net-device-up IFACE=eth1 #start on started net-device-up IFACE=eth2 #start on started net-device-up IFACE=eth0 |
CentOS/Redhat service start and stop
Are you trying to start the service upstart?
I am not very clear but I am guessing you want to get the effect of command Code:
service upstart start On CentOS you can do Code:
chkconfig --level 35 service_name on In particular you may issue command Code:
chkconfig --level 35 upstart on From: Farzan Jameel Mufti MS (CS, Theoretical Math), MEng (Internetworking) |
Hi Farzan,
I'm not trying to start Upstart - Upstart is the replacement for init and is probably the first process launched by the kernel automatically. I'm trying to have Upstart start my script after any event other than a runlevel change. The default runlevel of this machine is runlevel 4 and as you can see in the script quoted above, requires 3 network interfaces (eth0, eth1, eth2). So it would have to be triggered by any event after runlevel4 is reached and after all network interfaces are brought online. Thanks |
Sorry, I keep my knowledge up to date but did not know that init has been replaced. Well, I issued command pstree on my CentOS 6.0 and it still shows me init as the first process.
In any case, my answer above should still solve your problem. I would not try to mess with the start up script of any process. You still need to know chkconfig command and instead of --level 35 you would need --level 4. If you can name a few services that you would need to start and stop I can tell you the commands. Apart, you can try the utility ntsysv Hope this helps. From: Farzan Jameel Mufti MS (CS, Theoretical Math), MEng (Internetworking) |
Hi,
what about starting the script after all the services have started on reboot, from "rc.local" ? A sudo & su from rc.local example. good luck |
All times are GMT -5. The time now is 03:26 AM. |