Re: /etc/rc: fsck -y

2018-01-18 Thread Job Snijders
On Thu, Jan 18, 2018 at 12:22:21PM +, Stuart Henderson wrote:
> A flag (fsck_flags) would be a better idea than a file, and more
> flexible (users with many disks and low RAM could use the same
> mechanism to force "-l 1" for example).

fsck_flags would be an idea. I prefer not to bring local changes into /etc/rc

Kind regards,

Job

diff --git etc/rc etc/rc
index c88e13ce7ab..bfe76b1c598 100644
--- etc/rc
+++ etc/rc
@@ -349,7 +349,7 @@ if [[ -e /fastboot ]]; then
echo "Fast boot: skipping disk checks."
 elif [[ $1 == autoboot ]]; then
echo "Automatic boot in progress: starting file system checks."
-   do_fsck
+   do_fsck $fsck_flags
 fi
 
 # From now on, allow user to interrupt (^C) the boot process.
diff --git etc/rc.conf etc/rc.conf
index 05146d58a4e..7f116896b2d 100644
--- etc/rc.conf
+++ etc/rc.conf
@@ -100,6 +100,7 @@ multicast=NO# Reject IPv4 multicast packets 
by default
 
 # miscellaneous other flags
 amd_master=/etc/amd/master # AMD 'master' map
+fsck_flags=# "-l 1" to limit the number of parallel checks
 library_aslr=YES   # set to NO to disable library randomization
 savecore_flags=# "-z" to compress
 spamd_black=NO # set to YES to run spamd without greylisting



Re: /etc/rc: fsck -y

2018-01-18 Thread Stuart Henderson
On 2018/01/18 13:30, Artturi Alm wrote:
> On Thu, Jan 18, 2018 at 12:13:54PM +0100, Otto Moerbeek wrote:
> > On Thu, Jan 18, 2018 at 12:12:39PM +0200, Artturi Alm wrote:
> > 
> > > Hi,
> > > 
> > > i think i've never answered "n" to fsck, so to me the lack of -y does
> > > mean unnecessary work/boards/VMs left waiting for the F..
> > > 
> > > i would use something like this if it was there:
> > > 
> > > diff --git a/etc/rc b/etc/rc
> > > index c88e13ce7ab..e3a269be818 100644
> > > --- a/etc/rc
> > > +++ b/etc/rc
> > > @@ -349,7 +349,11 @@ if [[ -e /fastboot ]]; then
> > >   echo "Fast boot: skipping disk checks."
> > >  elif [[ $1 == autoboot ]]; then
> > >   echo "Automatic boot in progress: starting file system checks."
> > > - do_fsck
> > > + if [[ -e /failboot ]]; then
> > > + do_fsck
> > > + else
> > > + do_fsck -y
> > > + fi
> > >  fi
> > >  
> > >  # From now on, allow user to interrupt (^C) the boot process.
> > > 
> > > 
> > > but the one below is what i believe should fit w/modern sane defaults
> > > (think terabytes).
> > > no man page diffs, as i guess this won't fly (w/o bikeshedding atleast).
> > > -Artturi
> > > 
> > > 
> > > diff --git a/etc/rc b/etc/rc
> > > index c88e13ce7ab..e3a269be818 100644
> > > --- a/etc/rc
> > > +++ b/etc/rc
> > > @@ -349,7 +349,11 @@ if [[ -e /fastboot ]]; then
> > >   echo "Fast boot: skipping disk checks."
> > >  elif [[ $1 == autoboot ]]; then
> > >   echo "Automatic boot in progress: starting file system checks."
> > > - do_fsck
> > > + if [[ -e /failboot ]]; then
> > > + do_fsck
> > > + else
> > > + do_fsck -y
> > > + fi
> > >  fi
> > >  
> > >  # From now on, allow user to interrupt (^C) the boot process.
> > 
> > This has come up before and is not ok.
> > It is dangerous becuase it might make things worse.
> > 
> > I want to have a chanche to e.g. save an image or chack cabling.
> > 
> > Again, no.
> > 
> > -Otto
> 
> Ok, anyway the first diff was supposed to be this:
> 
> diff --git a/etc/rc b/etc/rc
> index c88e13ce7ab..c8a25da7b42 100644
> --- a/etc/rc
> +++ b/etc/rc
> @@ -349,7 +349,11 @@ if [[ -e /fastboot ]]; then
>   echo "Fast boot: skipping disk checks."
>  elif [[ $1 == autoboot ]]; then
>   echo "Automatic boot in progress: starting file system checks."
> - do_fsck
> + if [[ -e /forceboot ]]; then
> + do_fsck -y
> + else
> + do_fsck
> + fi
>  fi
>  
>  # From now on, allow user to interrupt (^C) the boot process.
> 
> 
> so only giving user the choice of not editing /etc/rc.
> fwiw. i heard FreeBSD has variable named "fsck_y_enable",
> but i'm useless w/shell scripts, so i chose above..
> -Artturi
> 

A flag (fsck_flags) would be a better idea than a file, and more
flexible (users with many disks and low RAM could use the same
mechanism to force "-l 1" for example).

But the number of times fsck -y has come up and been rejected
already, I don't think anything making it easier is likely to be
accepted.

On those machines without out-of-band console where I want the
"I don't care if this system shoots itself in the foot because I'll
have to drive to fix it whichever way it fails" mode, I just edit
/etc/rc...



Re: /etc/rc: fsck -y

2018-01-18 Thread Tom Smyth
Hi All,

For what its worth.. if they are devices that are regularly rebooted without
proper shutdown,( you may be better off avoiding the situation where FSCK
has to run)

I have found As Otto has pointed out fsck and  all the way doesn't work
 so well in some cases.

The most risk adverse way I have found for Routers /  firewalls in the field
was to use mfs  memory backed file systems where there are regular
changes (/var /tmp) and use default ffs
 (with noatime mount option ) for everything else, it reduces the
probability of FSCK having to run due to a write /
 incomplete write during loss of power ...
in the event of some other issue  (hardware failure) well  MFS
 wont help in that case,

I hope this helps
Peace out
Tom Smyth


On 18 January 2018 at 11:30, Artturi Alm  wrote:
> On Thu, Jan 18, 2018 at 12:13:54PM +0100, Otto Moerbeek wrote:
>> On Thu, Jan 18, 2018 at 12:12:39PM +0200, Artturi Alm wrote:
>>
>> > Hi,
>> >
>> > i think i've never answered "n" to fsck, so to me the lack of -y does
>> > mean unnecessary work/boards/VMs left waiting for the F..
>> >
>> > i would use something like this if it was there:
>> >
>> > diff --git a/etc/rc b/etc/rc
>> > index c88e13ce7ab..e3a269be818 100644
>> > --- a/etc/rc
>> > +++ b/etc/rc
>> > @@ -349,7 +349,11 @@ if [[ -e /fastboot ]]; then
>> > echo "Fast boot: skipping disk checks."
>> >  elif [[ $1 == autoboot ]]; then
>> > echo "Automatic boot in progress: starting file system checks."
>> > -   do_fsck
>> > +   if [[ -e /failboot ]]; then
>> > +   do_fsck
>> > +   else
>> > +   do_fsck -y
>> > +   fi
>> >  fi
>> >
>> >  # From now on, allow user to interrupt (^C) the boot process.
>> >
>> >
>> > but the one below is what i believe should fit w/modern sane defaults
>> > (think terabytes).
>> > no man page diffs, as i guess this won't fly (w/o bikeshedding atleast).
>> > -Artturi
>> >
>> >
>> > diff --git a/etc/rc b/etc/rc
>> > index c88e13ce7ab..e3a269be818 100644
>> > --- a/etc/rc
>> > +++ b/etc/rc
>> > @@ -349,7 +349,11 @@ if [[ -e /fastboot ]]; then
>> > echo "Fast boot: skipping disk checks."
>> >  elif [[ $1 == autoboot ]]; then
>> > echo "Automatic boot in progress: starting file system checks."
>> > -   do_fsck
>> > +   if [[ -e /failboot ]]; then
>> > +   do_fsck
>> > +   else
>> > +   do_fsck -y
>> > +   fi
>> >  fi
>> >
>> >  # From now on, allow user to interrupt (^C) the boot process.
>>
>> This has come up before and is not ok.
>> It is dangerous becuase it might make things worse.
>>
>> I want to have a chanche to e.g. save an image or chack cabling.
>>
>> Again, no.
>>
>>   -Otto
>
> Ok, anyway the first diff was supposed to be this:
>
> diff --git a/etc/rc b/etc/rc
> index c88e13ce7ab..c8a25da7b42 100644
> --- a/etc/rc
> +++ b/etc/rc
> @@ -349,7 +349,11 @@ if [[ -e /fastboot ]]; then
> echo "Fast boot: skipping disk checks."
>  elif [[ $1 == autoboot ]]; then
> echo "Automatic boot in progress: starting file system checks."
> -   do_fsck
> +   if [[ -e /forceboot ]]; then
> +   do_fsck -y
> +   else
> +   do_fsck
> +   fi
>  fi
>
>  # From now on, allow user to interrupt (^C) the boot process.
>
>
> so only giving user the choice of not editing /etc/rc.
> fwiw. i heard FreeBSD has variable named "fsck_y_enable",
> but i'm useless w/shell scripts, so i chose above..
> -Artturi
>



Re: /etc/rc: fsck -y

2018-01-18 Thread Artturi Alm
On Thu, Jan 18, 2018 at 12:13:54PM +0100, Otto Moerbeek wrote:
> On Thu, Jan 18, 2018 at 12:12:39PM +0200, Artturi Alm wrote:
> 
> > Hi,
> > 
> > i think i've never answered "n" to fsck, so to me the lack of -y does
> > mean unnecessary work/boards/VMs left waiting for the F..
> > 
> > i would use something like this if it was there:
> > 
> > diff --git a/etc/rc b/etc/rc
> > index c88e13ce7ab..e3a269be818 100644
> > --- a/etc/rc
> > +++ b/etc/rc
> > @@ -349,7 +349,11 @@ if [[ -e /fastboot ]]; then
> > echo "Fast boot: skipping disk checks."
> >  elif [[ $1 == autoboot ]]; then
> > echo "Automatic boot in progress: starting file system checks."
> > -   do_fsck
> > +   if [[ -e /failboot ]]; then
> > +   do_fsck
> > +   else
> > +   do_fsck -y
> > +   fi
> >  fi
> >  
> >  # From now on, allow user to interrupt (^C) the boot process.
> > 
> > 
> > but the one below is what i believe should fit w/modern sane defaults
> > (think terabytes).
> > no man page diffs, as i guess this won't fly (w/o bikeshedding atleast).
> > -Artturi
> > 
> > 
> > diff --git a/etc/rc b/etc/rc
> > index c88e13ce7ab..e3a269be818 100644
> > --- a/etc/rc
> > +++ b/etc/rc
> > @@ -349,7 +349,11 @@ if [[ -e /fastboot ]]; then
> > echo "Fast boot: skipping disk checks."
> >  elif [[ $1 == autoboot ]]; then
> > echo "Automatic boot in progress: starting file system checks."
> > -   do_fsck
> > +   if [[ -e /failboot ]]; then
> > +   do_fsck
> > +   else
> > +   do_fsck -y
> > +   fi
> >  fi
> >  
> >  # From now on, allow user to interrupt (^C) the boot process.
> 
> This has come up before and is not ok.
> It is dangerous becuase it might make things worse.
> 
> I want to have a chanche to e.g. save an image or chack cabling.
> 
> Again, no.
> 
>   -Otto

Ok, anyway the first diff was supposed to be this:

diff --git a/etc/rc b/etc/rc
index c88e13ce7ab..c8a25da7b42 100644
--- a/etc/rc
+++ b/etc/rc
@@ -349,7 +349,11 @@ if [[ -e /fastboot ]]; then
echo "Fast boot: skipping disk checks."
 elif [[ $1 == autoboot ]]; then
echo "Automatic boot in progress: starting file system checks."
-   do_fsck
+   if [[ -e /forceboot ]]; then
+   do_fsck -y
+   else
+   do_fsck
+   fi
 fi
 
 # From now on, allow user to interrupt (^C) the boot process.


so only giving user the choice of not editing /etc/rc.
fwiw. i heard FreeBSD has variable named "fsck_y_enable",
but i'm useless w/shell scripts, so i chose above..
-Artturi



Re: /etc/rc: fsck -y

2018-01-18 Thread Otto Moerbeek
On Thu, Jan 18, 2018 at 12:12:39PM +0200, Artturi Alm wrote:

> Hi,
> 
> i think i've never answered "n" to fsck, so to me the lack of -y does
> mean unnecessary work/boards/VMs left waiting for the F..
> 
> i would use something like this if it was there:
> 
> diff --git a/etc/rc b/etc/rc
> index c88e13ce7ab..e3a269be818 100644
> --- a/etc/rc
> +++ b/etc/rc
> @@ -349,7 +349,11 @@ if [[ -e /fastboot ]]; then
>   echo "Fast boot: skipping disk checks."
>  elif [[ $1 == autoboot ]]; then
>   echo "Automatic boot in progress: starting file system checks."
> - do_fsck
> + if [[ -e /failboot ]]; then
> + do_fsck
> + else
> + do_fsck -y
> + fi
>  fi
>  
>  # From now on, allow user to interrupt (^C) the boot process.
> 
> 
> but the one below is what i believe should fit w/modern sane defaults
> (think terabytes).
> no man page diffs, as i guess this won't fly (w/o bikeshedding atleast).
> -Artturi
> 
> 
> diff --git a/etc/rc b/etc/rc
> index c88e13ce7ab..e3a269be818 100644
> --- a/etc/rc
> +++ b/etc/rc
> @@ -349,7 +349,11 @@ if [[ -e /fastboot ]]; then
>   echo "Fast boot: skipping disk checks."
>  elif [[ $1 == autoboot ]]; then
>   echo "Automatic boot in progress: starting file system checks."
> - do_fsck
> + if [[ -e /failboot ]]; then
> + do_fsck
> + else
> + do_fsck -y
> + fi
>  fi
>  
>  # From now on, allow user to interrupt (^C) the boot process.

This has come up before and is not ok.
It is dangerous becuase it might make things worse.

I want to have a chanche to e.g. save an image or chack cabling.

Again, no.

-Otto



/etc/rc: fsck -y

2018-01-18 Thread Artturi Alm
Hi,

i think i've never answered "n" to fsck, so to me the lack of -y does
mean unnecessary work/boards/VMs left waiting for the F..

i would use something like this if it was there:

diff --git a/etc/rc b/etc/rc
index c88e13ce7ab..e3a269be818 100644
--- a/etc/rc
+++ b/etc/rc
@@ -349,7 +349,11 @@ if [[ -e /fastboot ]]; then
echo "Fast boot: skipping disk checks."
 elif [[ $1 == autoboot ]]; then
echo "Automatic boot in progress: starting file system checks."
-   do_fsck
+   if [[ -e /failboot ]]; then
+   do_fsck
+   else
+   do_fsck -y
+   fi
 fi
 
 # From now on, allow user to interrupt (^C) the boot process.


but the one below is what i believe should fit w/modern sane defaults
(think terabytes).
no man page diffs, as i guess this won't fly (w/o bikeshedding atleast).
-Artturi


diff --git a/etc/rc b/etc/rc
index c88e13ce7ab..e3a269be818 100644
--- a/etc/rc
+++ b/etc/rc
@@ -349,7 +349,11 @@ if [[ -e /fastboot ]]; then
echo "Fast boot: skipping disk checks."
 elif [[ $1 == autoboot ]]; then
echo "Automatic boot in progress: starting file system checks."
-   do_fsck
+   if [[ -e /failboot ]]; then
+   do_fsck
+   else
+   do_fsck -y
+   fi
 fi
 
 # From now on, allow user to interrupt (^C) the boot process.