Skip to content

Commit

Permalink
rc: add a safety sync after the recovery stage to avoid a vicious cycle
Browse files Browse the repository at this point in the history
The current fix now works as expected and always brings back the
console login after an unclean shutdown, which was previously not
happening.  A small quirk, however, is that while the base system
recovers, the OPNsense backend on top may not fully recover directly
after the unclean shutdown.  In those instances, a manual reboot
will bring back the fully operational system and its services.

The unclean shutdown dilemma is, however, an unavoidable occurrence
and any kernel panic or power failure can corrupt the file system
into an unrecoverable state.  Having snapshots or backups at hand is
a good habit to get into, which can also 'fix' the eventual breakdown
of a physical disk.

Discussed with: ad@ jos@
Tested by: jos@
  • Loading branch information
fichtner committed Jul 1, 2015
1 parent 9b58345 commit f45171e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/etc/rc.recover
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ function recover_rebuild()
{
passthru('/usr/sbin/pwd_mkdb -p /etc/master.passwd');
passthru('/usr/sbin/pwd_mkdb /etc/master.passwd');
passthru('/bin/sync');
}

/* first stage recovers the base system state */
Expand Down

0 comments on commit f45171e

Please sign in to comment.