From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Dyer, Steve J." Newsgroups: gmane.os.tru64.managers Subject: how to detect reboot or shutdown in a script Date: Tue, 05 Nov 2002 17:08:49 -0500 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: <2E4FF0D441295F44810338B1E860CA100D5498@noaadc-mxu17.NOA.Alcoa.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Trace: main.gmane.org 1036534066 18803 80.91.224.249 (5 Nov 2002 22:07:46 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 5 Nov 2002 22:07:46 +0000 (UTC) Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.20.101]) by main.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 189BrJ-0004se-00 for ; Tue, 05 Nov 2002 23:07:41 +0100 Original-Received: (qmail 10009 invoked by uid 5); 5 Nov 2002 22:08:59 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 9990 invoked by uid 49493); 5 Nov 2002 22:08:58 -0000 Original-Received: from Steve.Dyer@alcoa.com by sws1 by uid 49491 with qmail-scanner-1.14 (clamscan: 0.51. spamassassin: 2.50-cvs. Clear:SA:0(-1.2/5.0):. Processed in 0.363531 secs); 05 Nov 2002 22:08:58 -0000 Original-Received: from unknown (HELO emroute2.cind.ornl.gov) (128.219.159.41) by 0 with SMTP; 5 Nov 2002 22:08:58 -0000 Original-Received: from emroute2.cind.ornl.gov (LOCALHOST [127.0.0.1]) by emroute2.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0H5400EW8IUV3G@emroute2.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT Tru64-unix-managers@ornl.gov) ; Tue, 05 Nov 2002 17:08:58 -0500 (EST) Original-Received: from NOAADC-MSW03.NOA.Alcoa.com (noaadc-msw03.noa.alcoa.com [147.154.9.220]) by emroute2.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0H5400K8NIUSRQ@emroute2.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT Tru64-unix-managers@ornl.gov) ; Tue, 05 Nov 2002 17:08:52 -0500 (EST) Original-Received: from NOAADC-MXI02.NOA.Alcoa.com (unverified) by NOAADC-MSW03.NOA.Alcoa.com (Content Technologies SMTPRS 4.2.10) with ESMTP id for ; Tue, 05 Nov 2002 17:08:51 -0500 Original-Received: by NOAADC-MXI02.NOA.Alcoa.com with Internet Mail Service (5.5.2653.19) id ; Tue, 05 Nov 2002 17:08:51 -0500 Content-return: allowed Original-To: Tru64-unix-managers@ornl.gov X-Mailer: Internet Mail Service (5.5.2653.19) Xref: main.gmane.org gmane.os.tru64.managers:2333 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:2333 We are using Tru64 v5.1A and have this issue: We have a script that may be run either by hand or through the normal startup process (linked into rc3.d). The script uses both the "stop" and "start" arguments. Within that script, is there way to detect whether it was run directly by the root account as opposed to being run as a result of a reboot or a shutdown ? I am able to tell the difference on the "start" path by using the LOGINNAME variable. I'm not sure how to do this on the "stop" path. Thanks, Steve Dyer ALCOA, Inc.