Xref: utzoo comp.unix.questions:31018 comp.unix.misc:1409 comp.unix.sysv386:7721 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!viusys!uxui!unislc!harem!wes From: wes@harem.clydeunix.com (Wes Peters) Newsgroups: comp.unix.questions,comp.unix.misc,comp.unix.sysv386 Subject: Re: Current Run-Level: How can you tell? Summary: Look in wtmp! Keywords: init run level Message-ID: <226@harem.clydeunix.com> Date: 1 May 91 20:12:46 GMT References: <1991Apr23.024433.10460@srwic.UUCP> <599@fciva.FRANKCAP.COM> Organization: Raxco, Inc., Orem, UT Lines: 20 In article <599@fciva.FRANKCAP.COM>, dag@fciva.FRANKCAP.COM (Daniel A. Graifer) writes: > It may depend on your version of unix, but in my port of SysV 3.1.2 > "who -r" reports various things about init including the current run > level. Many of the vendor supplied rc2.d init files use this to make > sure certain things do/don't happen during transition from one state > to another. > > I don't know how you would do it from 'c'. Use getutent(3) on {/etc,/usr/adm}/wtmp to find the LAST run-level entry. Sorry, I don't have any System V man pages with me, or I'd try to hack up a simple loop for you. Getutent(3) and utmp(5) should have enough info to get you started. Wes Peters -- #include The worst day sailing My opinions, your screen. is much better than Raxco had nothing to do with this! the best day at work. Wes Peters: wes@harem.clydeunix.com ...!sun!unislc!harem!wes