From owner-freebsd-questions@freebsd.org Tue Jun 12 15:09:50 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 8B421101CF30 for ; Tue, 12 Jun 2018 15:09:50 +0000 (UTC) (envelope-from jude.obscure@yandex.com) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1542768C4A for ; Tue, 12 Jun 2018 15:09:50 +0000 (UTC) (envelope-from jude.obscure@yandex.com) Received: from mxback14g.mail.yandex.net (mxback14g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:93]) by forward103j.mail.yandex.net (Yandex) with ESMTP id 3F61B34C3F21 for ; Tue, 12 Jun 2018 18:09:38 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback14g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id mBUau1v7Cd-9ca0qo78; Tue, 12 Jun 2018 18:09:38 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.com; s=mail; t=1528816178; bh=PrcKf2G+aRQ4YAuERnU2PEYKPPOGTiaZTOPA6Q4rJXA=; h=To:From:Subject:Message-ID:Date; b=Vt/wBel/E0ocaVKkcATZxxtcKgXQKdwFmMgS8/RKldJuuzIcPXoq+wHfQ3g3QDgFk B78ur5j+4v1D08UmhXzIeCk3OBh63y2qQ3ogr6kESHFT/m2Ohbc4kj94MdAmt6ichW YdUImAGRUPFxyNAJsgJewVqgo0HmjmD8MsX+73Kk= Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id WL2dZH4YwR-9aAas8lP; Tue, 12 Jun 2018 18:09:37 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.com; s=mail; t=1528816177; bh=PrcKf2G+aRQ4YAuERnU2PEYKPPOGTiaZTOPA6Q4rJXA=; h=To:From:Subject:Message-ID:Date; b=X+o2A5rQKJKrdRlF5A3qQP64CNGU8wVqTquoyx60YsjObfOSfkXbDyeyDjtodB2+S rEzSR/I5OVgUQs7cxImvV5IWPq4Ojm4sw8JxOjQrb5uWQlK5pN1noX5KIIx6uL4rv7 jm2DG0iIcSQkPZqAI/iC91wERLuN73Zfq5LOhQpw= Authentication-Results: smtp2o.mail.yandex.net; dkim=pass header.i=@yandex.com To: freebsd-questions@freebsd.org From: Manish Jain Subject: How to detect single user mode in FreeBSD ? Message-ID: Date: Tue, 12 Jun 2018 20:38:08 +0530 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US 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: Tue, 12 Jun 2018 15:09:50 -0000 Hi, I am writing an fsck wrapper which first needs to check if the system is in single user mode. Under Linux, there appears to be a sysctl that shows whether the system is in single user mode:  sysctl -n kern.singleuser. Is there some similar facility under FreeBSD too ? Thanks for any tips. Manish Jain