1825768 Members
2082 Online
109687 Solutions
New Discussion

csh startup script

 
SOLVED
Go to solution
maria paschali
Frequent Advisor

csh startup script

hi everyone,

i would like to pick some brains please. I have created a csh startup script in /sbin/init.d directory. I have also created the symbolic links to Start and Kill these process when the server comes up and goes down.

When i test this script manually the process is started and stopped.

However, when i try rebooting the server, the rc.log tells me that the process has been started.

starting mpnet daemon: srvstart mpnet
Output from "/sbin/rc2.d/S900mpnet start":
----------------------------
Masterpiece Net Daemon Startup in progress

Rights for non-DOD U.S. Government Departments and Agencies are as set
forth in FAR 52.227-19(c)(1,2).
[1] 1077
mpmaster 1077 1073 0 13:31:29 console 0:00 mpcommsrv mpnet -s -j
mpnet daemon started


however, when i check to see if the process is actually running i get nothing.

#ps -ef | grep mpnet

root@k

Ive checked the ownership and file permissions of the file and they are owned by bin:bin and have permissions 555 set.

Any ideas, as i am fresh out of what i can try next.

Thanks in advance for your help.
5 REPLIES 5
S.K. Chan
Honored Contributor

Re: csh startup script

It may be that "mpnet" is dependent on other service/daemon to startup first before it can be started up successfully. Have you try starting it in rc3.d instead ? Make it the last process to run after everything had been started. Are all the paths defined correctly in the script ?
maria paschali
Frequent Advisor

Re: csh startup script

Hi,

I have tried your suggestion and moved the it to rc3.d

however, im still getting the same problem.

ie, rc.log says it has started up however, there is no record in the process listing.


starting mpnet daemon: srvstart mpnet
Output from "/sbin/rc3.d/S990mpnet start":
----------------------------
Masterpiece Net Daemon Startup in progress

Rights for non-DOD U.S. Government Departments and Agencies are as set
forth in FAR 52.227-19(c)(1,2).
[1] 1156
mpmaster 1156 1152 1 15:15:37 console 0:00 mpcommsrv mpnet -s -j
mpnet daemon started

**************************************************

Thanks
maria
Darrell Allen
Honored Contributor
Solution

Re: csh startup script

Hi Maria,

It looks like your script does start but then dies for some reason. I've had the same problem. The application vendor was no help so I came up with the following, crude work-around.

I check to see if the rc script is being called at boot (/sbin/rc is running). If so, I schedule an at job to re-run the rc script in 5 minutes. I've not had a problem since.

If you do this, just be sure the rc script is the last one to run (or at least make sure that /sbin/rc will have completed within 5 minutes).

# If called at boot time schedule an at job because the daemon starts then dies when called by /sbin/rc
/usr/bin/ps -ef | grep -q [/]sbin/rc
if [ $? -eq 0 ]
then
echo "/path_to_my_script >>/var/tmp/script.log 2>&1" | at now + 5 minutes
exit
fi
# normal "start" commands go here

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
James R. Ferguson
Acclaimed Contributor

Re: csh startup script

Hi:

Try launching the process in the background with 'nohup'.

Make sure too, sure that the environment variables are defined, particularly PATH.

Regards!

...JRF...
maria paschali
Frequent Advisor

Re: csh startup script

hi,

after much testing Darrell the additions seam to have worked well.

I appreciate your help and thank-you kindly.

I aslo tried the nohup command (since it was a lot less work) however, that did the same thing. ie startup and then die.

Once again,

thank-you all for helping me.