run level

Michael Henning michi at anvil.oz
Fri May 26 17:16:40 AEST 1989


I've stumbled across a problem regarding run levels. Basically, I am
writing a program which I want to run only in single user mode (it
does fancy things with raw device files). The problem is, how can I
reliably detect what the current run level is (I need to be able to do
this from within a normal user program, with root privileges). One idea
I had was to check whether /etc/utmp is empty. This seems to work on
Xenix systems, but also seems clumsy. Is there some elegant and reliable
way (i.e. portable) of asking init at what run level it is ?

Any help with this would be great. Mail me if you like, and I will summarize.

					Michi.
-- 
               | The opinions expressed are my own, not those of my employer. |
               |                                                              |
               | Michael (Michi) Henning                                      |
               | - We have three Michaels here, that's why they call me Michi |



More information about the Comp.unix.wizards mailing list