Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jun 2018 05:59:16 +0530
From:      Manish Jain <>
To:        jungle Boogie <>
Cc:        FreeBSD Questions <>
Subject:   Re: How to detect single user mode in FreeBSD ?
Message-ID:  <>
In-Reply-To: <>
References:  <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On 06/14/18 05:09, jungle Boogie wrote:
> Describe the problem you want to solve, not how.

The problem is this:

I am writing a shell script which can run fsck on all UFS / ext2 /ext4 
hard disk partitions listed in /etc/fstab.

The script should be portable and be able to run no matter whether the 
OS running is FreeBSD or Linux. The only thing that matters is that the 
commands fsck_ufs / fsck.ext2 and fsck.ext4 are available.

Ideally, the script should run only under single user mode, or else bail 
out immediately.

Linux has a clean way to find out whether the system is in single user 
mode. I would think, no matter what others on this list have said, 
sysctl under FreeBSD too should have a variable for indicating single 
user mode. But there currently is not any.

Tx and Regards
Manish Jain

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