[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: doubt about sync(1) for shutdown the system
From: |
Matias Fonzo |
Subject: |
Re: doubt about sync(1) for shutdown the system |
Date: |
Wed, 10 May 2017 21:34:56 -0300 |
On Wed, 10 May 2017 17:17:16 -0700
Pádraig Brady <address@hidden> wrote:
> On 10/05/17 15:49, Matias Fonzo wrote:
> > Hi there,
> >
> > I am writing a shutdown script for the boot process.
> >
> > I have a little question, which is exactly the order to apply
> > correctly sync(1)?:
> >
> > 1. Before to unmount swap devices, local/remote filesystems?.
> >
> > 2. Between the unmount of swap device(s) and local/remote
> > file systems?.
> >
> > 3. After to unmount everything?.
> >
> > 4. ... ?.
> >
> > Thanks,
> > Matias
> >
>
> Note sync(1) doesn't return any errors from sync(2)
> as the later always "succeeds".
> Also syncing is implicit in umount.
> Hence on modern systems calling sync(1) is IMHO redundant
> if doing a umount anyway.
> Consider also data written after the sync and before the umount.
> Therefore the kernel umount is the only place that can
> do that appropriate syncing without races.
Good. I was thinking in do that -- before and after, I do not consider
the after as "explicit", because the halt implementation that I have,
does the sync, too.
Thanks again,
Matías
pgp1p5MrbNReD.pgp
Description: OpenPGP digital signature