For booting I add things to
/etc/rc.d/rc.local.
For shutdown, I solved this issue on my box by first creating
/etc/rc.d/rc.shutdown. That way I don't have to tinker with the rc.6 script. Then in
/etc/rc.d/rc.6, immediately after PV declares the path variables, I added a call to run rc.shutdown:
#! /bin/sh
#
# rc.6 This file is executed by init when it goes into runlevel
# 0 (halt) or runlevel 6 (reboot). It kills all processes,
# unmounts file systems and then either halts or reboots.
blah, blah, etc. . .
# Set the path.
PATH=/sbin:/etc:/bin:/usr/bin
# Run the local shutdown procedure.
if [ -x /etc/rc.d/rc.shutdown ]; then
/etc/rc.d/rc.shutdown
fi
# If there are SystemV init scripts for this runlevel, run them.
if [ -x /etc/rc.d/rc.sysvinit ]; then
. /etc/rc.d/rc.sysvinit
fi
blah, blah, etc. . .
Quote:
you said path to script... I just have the one command I want run so how do I save it as a script I can run?. . .
|
In my setup, I would do this:
In rc.local:
mysql -u root -p pizzass mydb < /folder/rah.sql
In rc.shutdown:
mysqldump -u root -p pizzass mydb > /folder/rah.sql
I hope this helps.