Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatic command execution at statrtup

Status
Not open for further replies.

surnj1

Technical User
Dec 27, 2001
46
US
Hi Everybody,

(My system is Sco Openserver 5.0.6)
I have put some commands in /etc/rc.d/8/userdef file so that i can run that commands once during system start-up. But some how the system is not running the command.

As per my knowledge the time constraint (default 120 seccons)of rc script may prevent to run user command in /etc/rc.d/8/userdef, i have tried to increase it to 220 seconds in "rc2" script but still it doesn't work.

I also refered " but still i failed.

would some one help me?
 
What were the commands?

Is it possible that there are environment variables that need to be set for these commands to work?

Did you give a full path to the commands or just the command?


Look in /etc/rc2.d/messages for the log of P88USRDEFINE (which is what actually runs these rc.d scripts).

If the time limit really is what is killing you, you'd see that in the log. The way to fix that is to write ANOTHER script ( /usr/local/bin/myscript) and call that from userdef in background:

/usr/local/bin/myscrsipt &

That allows userdef to finish immediately but your spun off script can take whatever sweet time it needs.

Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
Thanks Tony,

Now problem get solved, It was due to "evironment variables"
to be set.

Thank you for your kind help.

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top