Re: [systemd-devel] umounting FS happens to be at the same time as shutting down services

2015-11-23 Thread Francis Moreau
On Sun, Nov 22, 2015 at 4:04 PM, Lennart Poettering
 wrote:
> On Sun, 22.11.15 15:26, Francis Moreau (francis.m...@gmail.com) wrote:
>
>> Hi,
>>
>> While rebooting, It seems to me that shutting down services while
>> unmounting some FS at the same time in an unordered fashion is not a
>> good idea since unmounting a FS can happen before a service using this
>> FS is stopped.
>>
>> Is this expected ?
>
> No, and it's not really what happends. Mounts from /etc/fstab are
> usually ordered with a Before= depdendency against local-fs.target,
> which is ordered Before= basic.target, which is the target that normal
> services are ordered After=. Hence, at startup you get the strict
> order:
>
>Mounts from /etc/fstab → local-fs.target → basic.target → normal services
>
> Now, in systemd the shutdown order is always the strict reverse of the
> start-up order, hence this results in this shutdown order:
>
>normal services → basic.target → local-fs.target → Mounts from /etc/fstab
>
> Thus, file systems are unmounted only *after* normal services have been
> terminated.
>
> Now, there are some services that set DefaultDependencies=no, and some
> mount units too. For those these automatic dependencies are not in
> effect, and they basically explicitly ask for the right to be ordered
> manually against whatever they want to be ordered against, and thus
> possibly are started or stopped in parallel. However, that's explicit
> configuration that way, and the exception.
>

Thank you very much for your detailed answer, it's clear now.
-- 
Francis
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] umounting FS happens to be at the same time as shutting down services

2015-11-22 Thread Reindl Harald



Am 22.11.2015 um 15:26 schrieb Francis Moreau:

While rebooting, It seems to me that shutting down services while
unmounting some FS at the same time in an unordered fashion is not a
good idea since unmounting a FS can happen before a service using this
FS is stopped


i don't think that's true because systemd stops services and targets in 
the reverse order of boot and tries to do as much as possible in 
parallel but *not* unordered




signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] umounting FS happens to be at the same time as shutting down services

2015-11-22 Thread Francis Moreau
Hi,

While rebooting, It seems to me that shutting down services while
unmounting some FS at the same time in an unordered fashion is not a
good idea since unmounting a FS can happen before a service using this
FS is stopped.

Is this expected ?

Thanks.
-- 
Francis
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] umounting FS happens to be at the same time as shutting down services

2015-11-22 Thread Lennart Poettering
On Sun, 22.11.15 15:26, Francis Moreau (francis.m...@gmail.com) wrote:

> Hi,
> 
> While rebooting, It seems to me that shutting down services while
> unmounting some FS at the same time in an unordered fashion is not a
> good idea since unmounting a FS can happen before a service using this
> FS is stopped.
> 
> Is this expected ?

No, and it's not really what happends. Mounts from /etc/fstab are
usually ordered with a Before= depdendency against local-fs.target,
which is ordered Before= basic.target, which is the target that normal
services are ordered After=. Hence, at startup you get the strict
order:

   Mounts from /etc/fstab → local-fs.target → basic.target → normal services

Now, in systemd the shutdown order is always the strict reverse of the
start-up order, hence this results in this shutdown order:

   normal services → basic.target → local-fs.target → Mounts from /etc/fstab

Thus, file systems are unmounted only *after* normal services have been
terminated.

Now, there are some services that set DefaultDependencies=no, and some
mount units too. For those these automatic dependencies are not in
effect, and they basically explicitly ask for the right to be ordered
manually against whatever they want to be ordered against, and thus
possibly are started or stopped in parallel. However, that's explicit
configuration that way, and the exception.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel