Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jun 2018 18:04:08 +0530
From:      Manish Jain <>
To:        Shane Ambler <FreeBSD@ShaneWare.Biz>,
Subject:   Re: How to detect single user mode in FreeBSD ?
Message-ID:  <>
In-Reply-To: <c0718db9-8b46-2301-a770-cd334cbf0f07@ShaneWare.Biz>
References:  <> <c0718db9-8b46-2301-a770-cd334cbf0f07@ShaneWare.Biz>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On 06/13/18 15:55, Shane Ambler wrote:
> When in single user mode PID 1 should be "/sbin/init -s" which becomes
> "/sbin/init --" in multi user mode.
> The next closet to knowing would be looking at mount, in single user
> mode you will only have / mounted read only and /dev. It is rare for any
> system to be past single user mode with only that mount setup but the
> user can mount the filesystems before starting your script and still be
> in single user mode.

Hi Shane,

Tx for replying. But don't you think there should ideally be a sysctl to 
be detect the runlevel, particularly single user mode ? It makes things 
easily documentible, just as when we can use sysctl to find out if the 
OS is virtualized (I think kern.vm_guest).

Manish Jain

Want to link to this message? Use this URL: <>