From owner-freebsd-questions@freebsd.org Wed Jun 13 23:30:32 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 D86591000B09 for ; Wed, 13 Jun 2018 23:30:31 +0000 (UTC) (envelope-from jd1008@gmail.com) Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BE96821DF for ; Wed, 13 Jun 2018 23:30:31 +0000 (UTC) (envelope-from jd1008@gmail.com) Received: by mail-it0-x244.google.com with SMTP id j135-v6so6289875itj.1 for ; Wed, 13 Jun 2018 16:30:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-transfer-encoding; bh=Xlf5cG9IooWI9i/Uf+R61aKgQijVd2wQ+31+4PQ08Cg=; b=IP5HPC2sQfKmop/0LGn2LL7PvP19vKk46wPwNOqlgRTmddrQKmnlZPT3Iy2CitQZ+P IxIwWOLJUUTW9JOE63WJBhNGmibEmmBa6KlEhUckL6Ucr+7CcY0HUWozNhcH1PECnc6G Mgd2SCGXMQdGGaSHSmkZ54BwWn6s2gTfXKQfHZyHi/0C5c3uABFUWJfiuiBxM22TJWKy Shd0iwSbUtrrQoOjmAeI9Inu3UY3NpS8Rqw7zhzo/z8KAXQ8Ua9BQgbpuofa11vd3t0N niAa98Q1atpkPlwx5/SLE4QgKEeeKNAqIctDRKpfD+oekERq38FM1eT0PaoeoCxGlWQp PbAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-transfer-encoding; bh=Xlf5cG9IooWI9i/Uf+R61aKgQijVd2wQ+31+4PQ08Cg=; b=uAvAAM7we0bYmdqDediQhXMNac5TqRc8O7YFZHliLbVf/vphAK533ifXb5B1rWVkf5 z3gFgbQ+beOKLVj5UOLojxrexHJ4FSwYi5KH8HgyzZCUdF8UJVP8o273RiooI9fsz6A3 DaH/qnqp4ae81nK4fWAgQVqZ1LalWfktTSCdGyu7AsGfa4VGnYtvixHXC5gjIGNGCLCZ FY6d1Onz/Qy9sroF4Q6dufttmFZwOpMT4QVmFDkMfciWu6dJvx6xG+0wLkBgVt2Pa98f Yc7D/3xuPZIGZRP++g9I8bUo/DId35LcicVq/ynJJbOgKMfUPj6Og8yLrwuylZAyeeHB Y/rg== X-Gm-Message-State: APt69E07a1Y1tbHj6bNvPcX2qrL3eguLTE+Z1hM+ZIc2Q32r/TgOagYg irGuVm/AqD+54qjt6Ek5EabxWg== X-Google-Smtp-Source: ADUXVKK8b/cTk2DOqAqvU0SQWwgzL76Kru46Kp581ESbktUGd20JdSXH+OL+vhXXY3KQis1yr6g6aQ== X-Received: by 2002:a24:af55:: with SMTP id l21-v6mr139371iti.55.1528932630523; Wed, 13 Jun 2018 16:30:30 -0700 (PDT) Received: from localhost.localdomain (50-243-4-3-static.hfc.comcastbusiness.net. [50.243.4.3]) by smtp.googlemail.com with ESMTPSA id h81-v6sm417138ith.2.2018.06.13.16.30.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jun 2018 16:30:29 -0700 (PDT) Message-ID: <5B21A915.3000209@gmail.com> Date: Wed, 13 Jun 2018 17:30:29 -0600 From: JD User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: Re: How to detect single user mode in FreeBSD ? References: <20180613141217.a3ab7160a55398bf5ed56ef2@sohara.org> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed 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 23:30:32 -0000 On 06/13/2018 05:20 PM, blubee blubeeme wrote: > On Wed, Jun 13, 2018, 22:49 Valeri Galtsev > wrote: > >> >> 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. >> > I can't agree with you more. FreeBSD isn't a Linux distribution. > > To the original poster of this question: Does the command who -r still work in FBSD?