[artix-general] [s6] How to add "sync" before umounting anything on reboot/shut-down?

Dudemanguy dudemanguy at artixlinux.org
Wed Mar 24 14:47:43 CET 2021


On 3/23/21 7:36 PM, Javier wrote:
> Hi !
> 
> I've been noticing that even though reboots and shutdowns cleanly occur, 
> when booting back, often a journal recovery happens.  That is weird to 
> me since there was no issue when the systems go down.
> 
> I was looking for "sync" being issued whether on one of the S6 scripts 
> or on the filesystem mount/umount S6 service, but found nothing is 
> calling "sync" prior to do final umount of anything.  I'm wondering if 
> there's a way to accomplish that.  I only noticed:
> 
> /etc/s6/sv/mount-filesystems
> 
> As a possible mount/umount oneshot, but I'm not sure if any S6 script 
> would be a better option.  Would adding the down to mount-filesystem be 
> the way?  How to successfully add "sync" before umounting anything when 
> rebooting/shutting-down with S6?
> 
> Thanks !
> 
> 

s6-linux-init unmounts filesystems during the shutdown process so a down
script anywhere in the s6-rc service would run a sync before anything
gets unmounted. I'm not sure this would actually do anything however as
there is no guarantee when this sync would be run exactly. A daemon 
could still be up and write to the disk afterwards.

A journal recovery is something that shouldn't normally happen though.
You can get one if you upgrade/reinstall s6 or s6-linux-init (the PID1
binary gets replaced), but in general it shouldn't happen.


More information about the artix-general mailing list