Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!elroy.jpl.nasa.gov!lll-winken!iggy.GW.Vitalink.COM!widener!cs.widener.edu!brendan From: brendan@cs.widener.edu (Brendan Kehoe) Newsgroups: comp.unix.admin Subject: There can be something like 'shutdownrc' at SunOS 4.1 ? Message-ID: Date: 29 May 91 14:46:50 GMT References: <868@cadlab.sublink.ORG> <1214@keele.keele.ac.uk> Reply-To: brendan@cs.widener.edu Organization: Widener CS Dept Lines: 29 In-Reply-To: csd35@seq1.keele.ac.uk's message of 29 May 91 08:11:59 GMT From: csd35@seq1.keele.ac.uk (Jonathan Knight) Date: 29 May 91 08:11:59 GMT Nope, that's not really as useful as shutdown running a script. Suppose we run an Oracle server, then what we want is the Oracle server to shut down at shutdown time, not before anyone has had the shutdown message. It would be really useful to have shutdown execute a script so that servers can be neatly closed down at the right moment. FTP to uunet.uu.net and get bsd-sources/sbin/shutdown.c, and have it do a system() call to your script inside the function die_you_gravy_sucking_pig_doc [haha GREAT function], in the if(doreboot) section and after if(dohalt). [That way, if you're rebooting or doing a normal shutdown it'll do your script, but if you want it to halt immediately it'll forget that.] Be really careful about the perms for your script. Compile, move /usr/etc/shutdown to /usr/etc/shutdown.sun, and plop your nice new program in its place (owned by root.operator, 4554). Now your users will get their warning and then everything will go down smoothly (like good brandy). This is just a thought -- hasn't been tried and isn't guaranteed. Brendan -- Brendan Kehoe - Widener Sun Network Manager - brendan@cs.widener.edu Widener University in Chester, PA A Bloody Sun-Dec War Zone