Current Run-Level: How can you tell?
Wes Peters
wes at harem.clydeunix.com
Thu May 2 06:12:46 AEST 1991
In article <599 at fciva.FRANKCAP.COM>, dag at 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 <std/disclaimer.h> 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 at harem.clydeunix.com ...!sun!unislc!harem!wes
More information about the Comp.unix.questions
mailing list