From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,c743c3f40fa61198,start X-Google-Attributes: gidf678f,public From: payerle@alexander.physics.umd.edu (Tom Payerle) Subject: How to get a script executed at shutdown? Date: 1997/08/08 Message-ID: <5sg0fh$hos$1@hecate.umd.edu>#1/1 X-Deja-AN: 262942049 Keywords: DU 4.0 Digital Unix shutdown Organization: Physics Department, University of Maryland Newsgroups: comp.unix.osf.misc I am interested in having certain machine-specific commands be executed when the machine (AS500 5/333) is shutdown. I have tried adding files of the sort /sbin/rc0.d/K99mystuff, and it successfully executes on an init 0, but apparently shutdown -h now and shutdown -r now do not actually do an init 0. (Man pages suggest that shutdown now [going to single user mode] will, haven't verified. Also states that -h and -r options do /sbin/halt and /sbin/reboot respectively, and no mention of init 0 in their man pages.) Therefore stuff in rc0.d are not being executed. I can do a hack by renaming /sbin/shutdown to /sbin/shutdown.orig and making my own /sbin/shutdown script which ends by calling shutdown.orig, but this would either require some serious programming or loss of functionality. (Eg, handling shutdown -h now is easy, but shutdown -h +500 is quite a bit harder, as I don't want my script running 500 minutes before the shutdown occurs.) Has anyone successfully dealt with this problem? Email responses (preferred) will be summarized to the group. Tom Payerle Dept of Physics payerle@physics.umd.edu University of Maryland (301) 405-6973 College Park, MD 20742 Fax: (301) 314-9525