Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

At Linux we can get run level as like:

if [ "$(runlevel | sed 's/.* //')" = 6 ]; then
  echo "A reboot is in progress"
fi

and run level 0 is for shutdown. How can I do the same for Free BSD?

share|improve this question

2 Answers 2

Runlevel is a concept specific to sysvinit (SystemV-style init). Other flavours of init used in Linux (for example, systemd) don't have concept of runlevel either.

The concept of runlevel also does not exist in BSD-style init, hence no runlevels in FreeBSD.

share|improve this answer

Testing the presence of

/var/run/nologin

file gives same information.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.