From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96076335021332.tru64-unix-managers.marc@archive.invalid> From: Guy Dallaire Date: Tue, 09 Jul 1996 18:04:03 +0000 To: tru64-unix-managers Subject: SUMMARY: Problems with shutdown -r AGAIN X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96076335021332 Thanks to all those who replied. Here is my original post: >>I posted a message recently, telling you about problems I had when I used the >>command "shutdown -r +xxx". I told you that my KILL scripts were not executed. >>That was a problem from my side. The DEC documentation says that in order to >>use that command, the system should be in single-user mode. This can be done >>with the command "shutdown +xxx" which DOES execute the kill scripts. I tried >>that and my kill scripts were run. >>Now for the fun part. A couple of days ago, I rebuilt a new kernel and decided >>to shutdown and reboot the system after having copied the new kernel. I issued >>the "shutdown now" command and my system stepped down to run level 0 and >>executed the appropriate KILL scripts (rc scripts I mean) >>after the following message, >>#INIT SINGLE-USER >>I said to myself, "Let`s reboot the system now" and issued the "shutdown -r >>now" command. Here's what I got: >>Shutdown at 09:40 (in 0 minutes) [pid 831] >>shutdown: /var/adm/utmp: No such file or directory >>And I've got no shutdown and/or reboot. I tried the same commands on 2 others >>servers running DU 3.2D-2 and got the same results. What I was told: It looks like when the system goes down to SINGLE-USER mode, all local file systems except / are dismounted. At that point, the shutdown command can no longer find /var/adm/utmp because it's a link into /usr... The work-arounds: a) Remount local file systems with bcheckrc before issuing the shutdown -r command. (I wonder if that solution could not lead to file system corruption ?) b) After going to single user with only / mounted, "sync" a couple of times and issue a reboot or halt command. Personally, I would go for the "sync" + reboot solution as it seems sager to me. One of those who replied told me: (Further question from me) > If i use a couple of "syncs" and the "reboot" command at that point, is it > as safe as using shutdown -r after remounting the local file systems ? Yes. After you've done a shutdown and everything has been dismounted, you really will not have any useful data in the buffer cache -- the main thing you need to worry about, usually, besides disrupting services to clients on the network, is corrupting your file systems. Killing off the daemons with shutdown (not -r or -h) gives them a chance to exit gracefully, and then all the file systems get dismounted, which causes them to be updated with all the in-memory pages. So you can even hit the reset button with little risk of damaging anything. The "halt" or "reboot" is simpler in some cases, especially if all you really need at that point is a reboot. HOPE THIS HELPS ! P.S.: Warning: That "Shutdown" command does not work as "advertized". If you use it without first goint to sigle user, it's only broadcasting a KILL signal to all processes, does not run the KILL scripts specified in /sbin/rcxxx.d and reboots the system. In my case, it did not even reboot, it hanged the system! If you look in the admin handbook, it's written (right in the middle of a paragraph) that you should FIRST step down to single user before using the -r option to shutdown. And when you do that, you get the behavior I posted a question about ! NICE command....