Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jun 2018 18:04:08 +0530
From:      Manish Jain <jude.obscure@yandex.com>
To:        Shane Ambler <FreeBSD@ShaneWare.Biz>, freebsd-questions@freebsd.org
Subject:   Re: How to detect single user mode in FreeBSD ?
Message-ID:  <f66e1b62-a6d5-c969-78ca-3ae9eb82efc5@yandex.com>
In-Reply-To: <c0718db9-8b46-2301-a770-cd334cbf0f07@ShaneWare.Biz>
References:  <e9731c0f-1269-8919-836a-29b9a2f6b0dc@yandex.com> <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: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?f66e1b62-a6d5-c969-78ca-3ae9eb82efc5>