Okay, I've been futzing with this for about a month now, I think and there is
something I'm still doing wrong, because it doesn't work. I'm hoping that a
fresh set of eyes can spot the problem.
I have a script, called "endurance" which I want to log when the system is
booted and when it is shutdown. "endurance" can be found at the end of this
message.
I put endurance in /etc/rc.d/init.d with 755 permissions, owned by root.root.
I have an explicit call to "/etc/rc.d/init.d/endurance start" at the end of
rc.local. I would like to just make a link in rc3.d, but I haven't yet
because of the problem which I will explain.
I have links in rc0.d and rc6.d, called K98endurance. When I cd to /etc/rc0.d
and run "sudo ./K98endurance stop", the entry in the logfile is made. When I
shut the system down, no entry is made.
All the bootup entries are working just fine.
I have tried changing the links to K02endurance, but no change. The log is on
the / filesystem, so the shutdown messages aren't being mounted over. Why
aren't the entries being made at shutdown?
My only thought is that if the / filesystem is remounted ro before the script
is called. This remounting is done by "init.d/halt", which is linked by
rc0.d/S01halt and rc6.d/S01reboot. The kill files are suppoed to be run
before the startup files, I think, so the / filesystem should still be rw when
endurance runs...
Anyone have any pointers on this??
-Michael
/etc/rc.d/init.d/endurance:
---------------------------------------------------------------------------
#!/bin/sh
# note the time of booting
logpath="/var/log/"
logfile="endurance"
case "$1" in
start)
# log the time of the system startup
echo -n "Booted at: " >> $logpath$logfile
date >> $logpath$logfile
;;
stop)
# record the uptime at shutdown
echo "Shut down: " >> $logpath$logfile
uptime >> $logpath$logfile
;;
status|restart|reload)
;;
*)
echo "lack of option" >> $logpath$logfile
esac
exit 0
---------------------------------------------------------------------------
--
No, my friend, the way to have good and safe government, is not to trust it
all to one, but to divide it among the many, distributing to every one exactly
the functions he is competent to. It is by dividing and subdividing these
republics from the national one down through all its subordinations, until it
ends in the administration of every man's farm by himself; by placing under
every one what his own eye may superintend, that all will be done for the
best.
-- Thomas Jefferson, to Joseph Cabell, 1816
--
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.