From owner-freebsd-questions@freebsd.org Wed Jun 13 14:46:53 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5787101211B for ; Wed, 13 Jun 2018 14:46:53 +0000 (UTC) (envelope-from galtsev@kicp.uchicago.edu) Received: from kicp.uchicago.edu (kicp.uchicago.edu [128.135.20.70]) by mx1.freebsd.org (Postfix) with ESMTP id 7033686FE5 for ; Wed, 13 Jun 2018 14:46:53 +0000 (UTC) (envelope-from galtsev@kicp.uchicago.edu) Received: from point.uchicago.edu (point.uchicago.edu [128.135.52.6]) by kicp.uchicago.edu (Postfix) with ESMTP id 8132271809A for ; Wed, 13 Jun 2018 09:46:47 -0500 (CDT) Subject: Re: How to detect single user mode in FreeBSD ? To: freebsd-questions@freebsd.org References: <20180613141217.a3ab7160a55398bf5ed56ef2@sohara.org> From: Valeri Galtsev Message-ID: Date: Wed, 13 Jun 2018 09:46:47 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180613141217.a3ab7160a55398bf5ed56ef2@sohara.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 14:46:53 -0000 On 06/13/18 08:12, Steve O'Hara-Smith wrote: > On Wed, 13 Jun 2018 18:04:08 +0530 > Manish Jain wrote: > >> 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 > > The runlevel concept comes from sysV init, it isn't a BSD thing at > all. There isn't a real difference at all between single user and multi > user. Single user mode is really just one of two states - before enabling > ttys and running the rc scripts with start or after disabling the ttys and > running the rc.shutdown script. There's nothing special about it. > > If you feel a need to test for single user then you should probably > be testing for something else - such as whether a filesystem is mounted > before running fsck on it which is what really matters and is completely > independent of whether or not the system is running multi-user. > Thanks, Steve, for great explanation! Being Linux refugee myself I know the gang from inside: we fall into wide spread of the spectrum, from learning hard (or re-learning and expanding knowledge in case of those of us who had a journey from UNIX to Linus and back) to actively demanding introduction into FreeBSD of familiar things: Linuxisms. Explanations like yours always are ultimately teach Linux refugees what FreeBSD is, and hopefully makes them (us ;-) stop demanding introduction of Linuxisms into FreeBSD. Valeri -- ++++++++++++++++++++++++++++++++++++++++ Valeri Galtsev Sr System Administrator Department of Astronomy and Astrophysics Kavli Institute for Cosmological Physics University of Chicago Phone: 773-702-4247 ++++++++++++++++++++++++++++++++++++++++