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] WorkingDirectory=~ not interpreted by systemd

2016-11-25 Thread Lennart Poettering
On Fri, 25.11.16 11:40, Benoit SCHMID (benoit.sch...@unige.ch) wrote:

> Good morning,
> 
> I have set the following service:
> [Unit]
> Description=SAP XXX
> After=autofs.service blk-availability.service 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/unige-startsap
> ExecStop=/sapmnt/XXX/exe/nuc/linuxx86_64/unige-stopsap
> Restart=no
> TimeoutStopSec=5min
> TimeoutStartSec=5min
> Type=forking
> WorkingDirectory=/home/xxxadm
> 
> [Install]
> WantedBy=multi-user.target
> 
> It works fine.
> If I run systemctl show, it show WorkingDirectory=/home/basadm.
> 
> If I set :
> WorkingDirectory=~
> it does not work any more because the process runs in a wrong directory.
> If I run systemctl show, it does not show the "WorkingDirectory=" line.
> 
> What am I doing wrong, when I set WorkingDirectory=~ ?
> 
> Thanks in advance for your answers.
> 
> PS: # systemctl --version -> systemd 219

IIRC that old systemd version doesn't support this syntax yet.

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] systemd-journald error

2016-11-25 Thread Lennart Poettering
On Fri, 25.11.16 05:33, Joel Miller (jm-hotm...@hotmail.com) wrote:

> Because I had misspelled the word "persistent" as "persisten" (dropping the
> final "t"), I received the following error:
> 
> [1.485872] systemd-journald[104]: [/etc/systemd/journald.conf:11] Failed
> to parse storage setting, ignoring: persisten
> 
> Despite correcting the .conf file (/etc/systemd/journald.conf in SuSE Leap
> 42.1), the error remains, perhaps because the value is cached somewhere in
> the system, but it is not causing any issues that I can detect.  I welcome
> any suggestions of where to look.

You have to restart journald of course?

Or maybe rebuild your initrd because the config file is also added to
the initrd on your distro?

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] Multiple notifications using sd_notify

2016-11-25 Thread Lennart Poettering
On Fri, 25.11.16 20:45, Raghavendra. H. R (raghuh...@gmail.com) wrote:

> Hi All,
> 
> Can we use sd_notify multiple times in any application to which can be used
> as notification for other processes.
> 
> If Process B & C both depends & need notification from Process A.
> Can we use sd_notify in Process A multiple times which can be used other
> processes at different times ?

sd_notify() is a communication channel between a service and the
systemd instance running it. It's nothing else really. It isn't really
suitable for communication with any other party.

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 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] systemd-journald error

2016-11-25 Thread Joel
Lennart -


Thank you for the reply.


It's not clear whether you are instructing me to do something (restart journald 
or rebuild initrd) or asking a question.


Please note that while I have some experience with Linux and the SuSE distro 
(about 11 years or so), this is the first time I am delving into systemd.


I was simply trying to find out where else the value (storage=persistent) is 
registered or cached.


Please clarify.  Thanks.


Joel Miller


From: Lennart Poettering 
Sent: Friday, November 25, 2016 11:33:28 AM
To: Joel Miller
Cc: systemd-devel@lists.freedesktop.org
Subject: Re: [systemd-devel] systemd-journald error

On Fri, 25.11.16 05:33, Joel Miller (jm-hotm...@hotmail.com) wrote:

> Because I had misspelled the word "persistent" as "persisten" (dropping the
> final "t"), I received the following error:
>
> [1.485872] systemd-journald[104]: [/etc/systemd/journald.conf:11] Failed
> to parse storage setting, ignoring: persisten
>
> Despite correcting the .conf file (/etc/systemd/journald.conf in SuSE Leap
> 42.1), the error remains, perhaps because the value is cached somewhere in
> the system, but it is not causing any issues that I can detect.  I welcome
> any suggestions of where to look.

You have to restart journald of course?

Or maybe rebuild your initrd because the config file is also added to
the initrd on your distro?

Lennart

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


[systemd-devel] Multiple notifications using sd_notify

2016-11-25 Thread Raghavendra. H. R
Hi All,

Can we use sd_notify multiple times in any application to which can be used
as notification for other processes.


If Process B & C both depends & need notification from Process A.
Can we use sd_notify in Process A multiple times which can be used other
processes at different times ?


--
Regards,

Raghavendra. H. R
(Raghu)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] WorkingDirectory=~ not interpreted by systemd

2016-11-25 Thread Benoit SCHMID
Good morning,

I have set the following service:
[Unit]
Description=SAP XXX
After=autofs.service blk-availability.service 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/unige-startsap
ExecStop=/sapmnt/XXX/exe/nuc/linuxx86_64/unige-stopsap
Restart=no
TimeoutStopSec=5min
TimeoutStartSec=5min
Type=forking
WorkingDirectory=/home/xxxadm

[Install]
WantedBy=multi-user.target

It works fine.
If I run systemctl show, it show WorkingDirectory=/home/basadm.

If I set :
WorkingDirectory=~
it does not work any more because the process runs in a wrong directory.
If I run systemctl show, it does not show the "WorkingDirectory=" line.

What am I doing wrong, when I set WorkingDirectory=~ ?

Thanks in advance for your answers.

PS: # systemctl --version -> systemd 219

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

 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


[systemd-devel] systemd-journald error

2016-11-25 Thread Joel Miller
Because I had misspelled the word "persistent" as "persisten" (dropping 
the final "t"), I received the following error:


[1.485872] systemd-journald[104]: [/etc/systemd/journald.conf:11] 
Failed to parse storage setting, ignoring: persisten


Despite correcting the .conf file (/etc/systemd/journald.conf in SuSE 
Leap 42.1), the error remains, perhaps because the value is cached 
somewhere in the system, but it is not causing any issues that I can 
detect.  I welcome any suggestions of where to look.


I am aware that I could reload the configuration for journald or the 
entire systemd.  And should neither of those work, I could reinstall 
systemd.


If I should have posted this on a different list, please let me know (I 
do have a thread on an openSuSE forum).


Thanks.

Joel Miller
973 736 8306
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] WorkingDirectory=~ not interpreted by systemd

2016-11-25 Thread Michael Chapman

[Accidentally replied off-list: resending here.]

On Fri, 25 Nov 2016, Benoit SCHMID wrote:

What am I doing wrong, when I set WorkingDirectory=~ ?

Thanks in advance for your answers.

PS: # systemctl --version -> systemd 219


Support for WorkingDirectory=~ was added in systemd v227.

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