piratepatrol
asked on
Starting a Process Automatically on Reboot
Hi Linux friends,
All I want to do is to have a process start automatically when the server reboots. Nothing fancy. Right now, I manually start the process like this:
[root@localhost root]# cd /programfiles/tibco/tra/do main/TuxDo main/
[root@localhost root]# ./hawkagent_TuxDomain
I also have another process where I have to send it a parameter:
[root@localhost root]# cd /programfiles/tibco/ems/bi n
[root@localhost root]# ./tibemsd -config FTBackup/tibemsd.conf
I know I have to do something with /etc/init.d, but I'm not sure exactly what.
Thank you so much,
Jazon
All I want to do is to have a process start automatically when the server reboots. Nothing fancy. Right now, I manually start the process like this:
[root@localhost root]# cd /programfiles/tibco/tra/do
[root@localhost root]# ./hawkagent_TuxDomain
I also have another process where I have to send it a parameter:
[root@localhost root]# cd /programfiles/tibco/ems/bi
[root@localhost root]# ./tibemsd -config FTBackup/tibemsd.conf
I know I have to do something with /etc/init.d, but I'm not sure exactly what.
Thank you so much,
Jazon
If you're running a Red Hat-ish distribution, you can put the commands in /etc/rc.d/rc.local
ASKER
I have Fedora Core 2.
The tricky part is that one of the processes is the type that if you start it in the console, it runs, but then stops if you close the console. Given that, can I still do the following:
cd /programfiles/tibco/tra/do main/TuxDo main/
./hawkagent_TuxDomain
cd /programfiles/tibco/ems/bi n
./tibemsd -config FTBackup/tibemsd.conf
The first one is the one that stops when I close the console.
Thanks again.
The tricky part is that one of the processes is the type that if you start it in the console, it runs, but then stops if you close the console. Given that, can I still do the following:
cd /programfiles/tibco/tra/do
./hawkagent_TuxDomain
cd /programfiles/tibco/ems/bi
./tibemsd -config FTBackup/tibemsd.conf
The first one is the one that stops when I close the console.
Thanks again.
> The first one is the one that stops when I close the console.
Try prepending "nohup " and appending "< /dev/null > /dev/null 2>&1" to the command, e.g:
nohup ./hawkagent_TuxDomain < /dev/null > /dev/null 2>&1
Try prepending "nohup " and appending "< /dev/null > /dev/null 2>&1" to the command, e.g:
nohup ./hawkagent_TuxDomain < /dev/null > /dev/null 2>&1
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I really appreciate this, Tim.
This is what I'm putting into the rc.local file...
# Start TIBCO Hawk Agent.
cd /programfiles/tibco/tra/do main/TuxDo main/hawka gent_TuxDo main
nohup ./hawkagent_TuxDomain < /dev/null > /dev/null 2>&1
# Start the primary and backup TIBCO EMS instances.
cd /programfiles/tibco/ems/bi n
nohup ./tibemsd < /dev/null > /dev/null 2>&1
nohup ./tibemsd -config FTBackup/tibemsd.conf < /dev/null > /dev/null 2>&1
# Start the TIBCO Administrator.
cd /programfiles/tibco/admini strator/do main/TuxDo main/bin
nohup ./tibcoadmin_TuxDomain < /dev/null > /dev/null 2>&1
Do you see any problems with this setup?
This is what I'm putting into the rc.local file...
# Start TIBCO Hawk Agent.
cd /programfiles/tibco/tra/do
nohup ./hawkagent_TuxDomain < /dev/null > /dev/null 2>&1
# Start the primary and backup TIBCO EMS instances.
cd /programfiles/tibco/ems/bi
nohup ./tibemsd < /dev/null > /dev/null 2>&1
nohup ./tibemsd -config FTBackup/tibemsd.conf < /dev/null > /dev/null 2>&1
# Start the TIBCO Administrator.
cd /programfiles/tibco/admini
nohup ./tibcoadmin_TuxDomain < /dev/null > /dev/null 2>&1
Do you see any problems with this setup?
> Do you see any problems with this setup?
No.
However I'm not familiar with the particular programs you are running.
No.
However I'm not familiar with the particular programs you are running.
ASKER
I'm going to reboot my Linux server and hope for the best! :)
I'm the TIBCO administrator for my company, and TIBCO is a huge software package used for systems integration.
We use all Microsoft at work, but I'm just playing with it in my Linux server at home. I'll let you know if all is well after the reboot. Your help is deeply appreciated.
I'm the TIBCO administrator for my company, and TIBCO is a huge software package used for systems integration.
We use all Microsoft at work, but I'm just playing with it in my Linux server at home. I'll let you know if all is well after the reboot. Your help is deeply appreciated.
ASKER
Hi Tim - here's the error I get . . . .
/etc/rc3.d/S99local: line 10: cd: /programfiles/tibco/tra/do main/TuxDo main/hawka gent_TuxDo main: No such file or directory
I don't know why it's saying this. Here's proof I didn't have a typo . . . :)
[root@localhost TuxDomain]# cd /programfiles/tibco/tra/do main/TuxDo main
[root@localhost TuxDomain]# ls
AdministrationDomain.prope rties hawkagent_TuxDomain plugin
application hawkagent_TuxDomain.tra rulebase
AuthorizationDomain.proper ties inithawk startup
autoconfig local.properties
hawkagent.cfg logs
[root@localhost TuxDomain]#
Any thoughts?
/etc/rc3.d/S99local: line 10: cd: /programfiles/tibco/tra/do
I don't know why it's saying this. Here's proof I didn't have a typo . . . :)
[root@localhost TuxDomain]# cd /programfiles/tibco/tra/do
[root@localhost TuxDomain]# ls
AdministrationDomain.prope
application hawkagent_TuxDomain.tra rulebase
AuthorizationDomain.proper
autoconfig local.properties
hawkagent.cfg logs
[root@localhost TuxDomain]#
Any thoughts?
ASKER
Oh gosh, I'm stupid. Hold on...
Heh, sorry I didn't catch that.
ASKER
Okay, I changed
cd /programfiles/tibco/tra/do main/TuxDo main/hawka gent_TuxDo main
to
cd /programfiles/tibco/tra/do main/TuxDo main
Heheh! My bad!
I rebooted, and right now it's hung on the following . . .
Starting system message bus: [ OK ]
And that's it. The cursor is blinking underneath, and it's not going to the login screen. I used PuTTY to connect to the Linux server from my Windows XP laptop, issued ps -ef , and I notice that only the Hawk Agent is started (this is the first process started from rc.local). All the others I specified in the rc.local file did not start. Weird.
Any thoughts on this issue? Thanks again.
cd /programfiles/tibco/tra/do
to
cd /programfiles/tibco/tra/do
Heheh! My bad!
I rebooted, and right now it's hung on the following . . .
Starting system message bus: [ OK ]
And that's it. The cursor is blinking underneath, and it's not going to the login screen. I used PuTTY to connect to the Linux server from my Windows XP laptop, issued ps -ef , and I notice that only the Hawk Agent is started (this is the first process started from rc.local). All the others I specified in the rc.local file did not start. Weird.
Any thoughts on this issue? Thanks again.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yes, as pjedmond said, just add an ampersand to the end of commands that don't background themselves.
ASKER
Worked like a charm! You guys are awesome. Thank you so much.