Re: [systemd-devel] after=local-fs not enforced

2016-11-25 Thread Andrei Borzenkov
25.11.2016 18:13, Benoit SCHMID пишет:
> Hello,
> 
> On 11/25/2016 04:47 AM, Andrei Borzenkov wrote:
>> Yes, this is the command that tries to unmount filesystems on LVM2
>> devices, thus bypassing systemd normal dependencies. The idea of such
>> service is very questionable, but it is probably not something you can
>> really change.
>>
>> You can try to add drop-in to order this service after
>> systemd-logind.service on shutdown, but I would contact RH and verify
>> that they agree to support this. In any case, this is not systemd issue.
> 
> A quick and dirty way of avoiding this is to add the following.
> After=blk-availability.service in my service.
> 
> Do you see any drawbacks by setting this?
> 

Not really. It should help with disappearing filesystems in your case.

> In most case, Linux admin should not see this umount problems
> because busy fs are not unmounted.
> On a SAP system running on Oracle you should always get the error.
> Because the oraarch is not busy except when the DB archives a redolog.
> Therefore blk-availability succeeds to umount oraarch because it is empty.
> Then SAP forces the archive of the current redolog.
> Then it needs to access this fs that has been unmounted:
> ###
> Stopping background process SMCO
> Thu Nov 24 14:51:59 2016
> Errors in file
> /oracle/XXX/saptrace/diag/rdbms/xxx/XXX/trace/XXX_arc2_12953.trc:
> ORA-19504: failed to create file
> "/oracle/XXX/oraarch/xxxarch1_530_927368778.dbf"
> ORA-27040: file create error, unable to create file
> Linux-x86_64 Error: 13: Permission denied
> Additional information: 1
> ARC2: Error 19504 Creating archive log file to
> '/oracle/XXX/oraarch/XXXarch1_530_927368778.dbf'
> ###
> 
> Honestly, what is disappointing is that RH does not consider LVM fs as
> local-fs.
> Now that I understand the problem, I consider this not a systemd problem,
> but rather a lvm systemd integration problem.
> What is frustrating, is that I have been having a call opened, for that,
> with RH, for more than two weeks.
> The only answer I got is : We are working on it :-(

What makes you think they are not? :) Anyway you can update them and
point to exact problematic service.

> But this is neither a systemd problem :-)
> 
> Thanks in advance for your answer.
> 

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] after=local-fs not enforced

2016-11-25 Thread Lennart Poettering
On Thu, 24.11.16 16:20, Benoit SCHMID (benoit.sch...@unige.ch) wrote:

> Hello,
> 
> We have defined the following sap_XXX.service.
> It contains the following in [Unit]:
> ###
> After=local-fs.target network-online.target ora_lsnr_XXX.service
> remote-fs.target
> Wants=ora_lsnr_XXX.service
> ###

Note that After=local-fs.target is redundant for regular
services. ("Regular" being defined here as service which do not set
DefaultDependencies=no). This is because if DefaultDependencies=yes is
set (which is the implied default for all services), then they gain an
ordering dep on basic.target which in turn is ordered against
local-fs.target. Hence, because ordering deps are transitive all
regular services are indirectly also ordered against local-fs.target.

The only case where you explicitly want to list "local-fs.target" in
your configuration is when you set DefaultDependencies=no and want to
become an early-boot service. Also see the bootup(7) man page about
this.

Note that in older systemd versions at least only mounts created via
/etc/fstab are ordered against "local-fs.target" by default. Mounts
created manually during runtime (by invoking /bin/mount for example)
are not.

Lennart

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


Re: [systemd-devel] after=local-fs not enforced

2016-11-25 Thread Benoit SCHMID
Hello,

On 11/25/2016 04:47 AM, Andrei Borzenkov wrote:
> Yes, this is the command that tries to unmount filesystems on LVM2
> devices, thus bypassing systemd normal dependencies. The idea of such
> service is very questionable, but it is probably not something you can
> really change.
>
> You can try to add drop-in to order this service after
> systemd-logind.service on shutdown, but I would contact RH and verify
> that they agree to support this. In any case, this is not systemd issue.

A quick and dirty way of avoiding this is to add the following.
After=blk-availability.service in my service.

Do you see any drawbacks by setting this?

In most case, Linux admin should not see this umount problems
because busy fs are not unmounted.
On a SAP system running on Oracle you should always get the error.
Because the oraarch is not busy except when the DB archives a redolog.
Therefore blk-availability succeeds to umount oraarch because it is empty.
Then SAP forces the archive of the current redolog.
Then it needs to access this fs that has been unmounted:
###
Stopping background process SMCO
Thu Nov 24 14:51:59 2016
Errors in file
/oracle/XXX/saptrace/diag/rdbms/xxx/XXX/trace/XXX_arc2_12953.trc:
ORA-19504: failed to create file
"/oracle/XXX/oraarch/xxxarch1_530_927368778.dbf"
ORA-27040: file create error, unable to create file
Linux-x86_64 Error: 13: Permission denied
Additional information: 1
ARC2: Error 19504 Creating archive log file to
'/oracle/XXX/oraarch/XXXarch1_530_927368778.dbf'
###

Honestly, what is disappointing is that RH does not consider LVM fs as
local-fs.
Now that I understand the problem, I consider this not a systemd problem,
but rather a lvm systemd integration problem.
What is frustrating, is that I have been having a call opened, for that,
with RH, for more than two weeks.
The only answer I got is : We are working on it :-(
But this is neither a systemd problem :-)

Thanks in advance for your answer.

-- 
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

 Benoit Schmid  Tel: (+41-22) 379-7209

 University of Geneva - Information Technology Division

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ 

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] after=local-fs not enforced

2016-11-24 Thread Andrei Borzenkov
25.11.2016 00:50, Benoit SCHMID пишет:
> Hello,
> 
> 
> On 11/24/2016 08:14 PM, Andrei Borzenkov wrote:
>> What is blkdeactivate? It does not belong to systemd.
> 
> You are asking too much, for me, Andrei because it comes from RH repo :-)
> 

Well, it appears it is part of LVM2.

Version 2.02.98 - 15th October 2012
  Introduce blkdeactivate script to deactivate block devs with dependencies.


> I have found this on my host:
> 
> # cat /usr/lib/systemd/system/blk-availability.service
> [Unit]
> Description=Availability of block devices
> After=lvm2-activation.service lvm2-lvmetad.service
> iscsi-shutdown.service iscsi.service iscsid.service fcoe.service
> DefaultDependencies=no
> Conflicts=shutdown.target
> 
> [Service]
> Type=oneshot
> ExecStart=/usr/bin/true
> ExecStop=/usr/sbin/blkdeactivate -u -l wholevg -m disablequeueing

Yes, this is the command that tries to unmount filesystems on LVM2
devices, thus bypassing systemd normal dependencies. The idea of such
service is very questionable, but it is probably not something you can
really change.

You can try to add drop-in to order this service after
systemd-logind.service on shutdown, but I would contact RH and verify
that they agree to support this. In any case, this is not systemd issue.

> RemainAfterExit=yes
> 
> [Install]
> WantedBy=sysinit.target
> 
> # systemctl status blk-availability
> ● blk-availability.service - Availability of block devices
>Loaded: loaded (/usr/lib/systemd/system/blk-availability.service;
> disabled; vendor preset: disabled)
>Active: active (exited) since Thu 2016-11-24 15:25:32 CET; 7h ago
>   Process: 2653 ExecStart=/usr/bin/true (code=exited, status=0/SUCCESS)
>  Main PID: 2653 (code=exited, status=0/SUCCESS)
>CGroup: /system.slice/blk-availability.service
> 
> Nov 24 15:25:32 beryl5 systemd[1]: Starting Availability of block
> devices...
> Nov 24 15:25:32 beryl5 systemd[1]: Started Availability of block devices.
> 
> Is this enough to answer your question?
> 

Well,

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] after=local-fs not enforced

2016-11-24 Thread Benoit SCHMID

Hello,


On 11/24/2016 08:14 PM, Andrei Borzenkov wrote:

What is blkdeactivate? It does not belong to systemd.


You are asking too much, for me, Andrei because it comes from RH repo :-)

I have found this on my host:

# cat /usr/lib/systemd/system/blk-availability.service
[Unit]
Description=Availability of block devices
After=lvm2-activation.service lvm2-lvmetad.service 
iscsi-shutdown.service iscsi.service iscsid.service fcoe.service

DefaultDependencies=no
Conflicts=shutdown.target

[Service]
Type=oneshot
ExecStart=/usr/bin/true
ExecStop=/usr/sbin/blkdeactivate -u -l wholevg -m disablequeueing
RemainAfterExit=yes

[Install]
WantedBy=sysinit.target

# systemctl status blk-availability
● blk-availability.service - Availability of block devices
   Loaded: loaded (/usr/lib/systemd/system/blk-availability.service; 
disabled; vendor preset: disabled)

   Active: active (exited) since Thu 2016-11-24 15:25:32 CET; 7h ago
  Process: 2653 ExecStart=/usr/bin/true (code=exited, status=0/SUCCESS)
 Main PID: 2653 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/blk-availability.service

Nov 24 15:25:32 beryl5 systemd[1]: Starting Availability of block devices...
Nov 24 15:25:32 beryl5 systemd[1]: Started Availability of block devices.

Is this enough to answer your question?

Thanks for your help.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] after=local-fs not enforced

2016-11-24 Thread Andrei Borzenkov
24.11.2016 18:20, Benoit SCHMID пишет:
> Hello,
> 
> We have defined the following sap_XXX.service.
> It contains the following in [Unit]:
> ###
> After=local-fs.target network-online.target ora_lsnr_XXX.service
> remote-fs.target
> Wants=ora_lsnr_XXX.service
> ###
> 
> Stopping and Starting the service with systemd runs fine.
> 
> When we reboot, systemd umounts local file systems,
> before sap_XXX is stopped.
> This is done although there is After=local-fs.target.
> 
> What are we missing?
> 
> Above there is the output with a few substitutions (XXX and YYY).
>  http://pastebin.com/nLJ5Zbgj
> 

Nov 24 15:22:03 hostname blkdeactivate[12482]: [UMOUNT]: unmounting
vg_yyysap-lv_yyyap_sap (dm-21) mounted on /usr/sap/YYY... done

What is blkdeactivate? It does not belong to systemd.

> # systemctl --version
> systemd 219
> 
> Thanks for your answer.
> 

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] after=local-fs not enforced

2016-11-24 Thread Benoit SCHMID
Hello,

On 11/24/2016 04:42 PM, Reindl Harald wrote:
>
> you *really* should post the whole systemd-unit instead pieces!
> have you played around with DefaultDependencies?

Here it is :-)
[Unit]
Description=SAP XXX
After=local-fs.target network-online.target ora_lsnr_XXX.service
remote-fs.target
Wants=ora_lsnr_XXX.service

[Service]
EnvironmentFile=/etc/default/sap_XXX
User=xxxadm
Group=sapsys
ExecStart=/sapmnt/XXX/exe/nuc/linuxx86_64/startsap
ExecStop=/sapmnt/XXX/exe/nuc/linuxx86_64/stopsap
Restart=no
TimeoutStopSec=5min
TimeoutStartSec=5min
Type=forking

[Install]
WantedBy=multi-user.target


Regards,

-- 
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

 Benoit Schmid  Tel: (+41-22) 379-7209

 University of Geneva - Information Technology Division

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ 

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] after=local-fs not enforced

2016-11-24 Thread Reindl Harald



Am 24.11.2016 um 16:20 schrieb Benoit SCHMID:

We have defined the following sap_XXX.service.
It contains the following in [Unit]:
###
After=local-fs.target network-online.target ora_lsnr_XXX.service
remote-fs.target
Wants=ora_lsnr_XXX.service
###

Stopping and Starting the service with systemd runs fine.

When we reboot, systemd umounts local file systems,
before sap_XXX is stopped.
This is done although there is After=local-fs.target.

What are we missing?

Above there is the output with a few substitutions (XXX and YYY).
 http://pastebin.com/nLJ5Zbgj


you *really* should post the whole systemd-unit instead pieces!
have you played around with DefaultDependencies?
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel