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!

Automate Processes 1

Status
Not open for further replies.

Roomer

Technical User
Oct 1, 2001
100
GB
I have been requested to automate certain process at system startup and system shutdown.

Obviously at system startup, I can insert the processes into the /etc/inittab file.

Is there an equivalent file for system shutdowns?
I don't think I've ever heard of one... have you?

Thanks,

Roomer..
 
Roomer,

Use /etc/rc.shutdown

If you look at the /usr/sbin/shutdown script - if the /etc/rc.shutdown scripts exists it is called before performing any shutdown tasks.

One tip though - whatever you do in the script end it with a:

exit 0

You will need to send out a return code of 0 or the system may not shutdown.

Best of luck

PSD
IBM Certified Specialist - AIX V4.3 Systems Support
IBM Certified Specialist - AIX V4 HACMP
 
PSD,

thanks for the info.. I have looked on each of my systems, but cannot seem to find any /etc/rc.shutdown files...
Is this a file that needs creating?

Also, the processes that I need to start/stop automatically, need to be executed by a particular user..

Any thoughts there ?

Thanks,
Roomer
 
Roomer,

Yes you need to touch the file first.

In order to stop processes as a particular user use:

su - user -c "db2stop"

Cheers


PSD
IBM Certified Specialist - AIX V4.3 Systems Support
IBM Certified Specialist - AIX V4 HACMP
 
PSD..

a great help ! - I'll go off now and try and set this up.!!

Roomer
 
Make sure you have good error-catching or /etc/rc.shutdown might die and system may not halt.
 
Even minor databases have documented way to get down cleanly
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top