Re: [systemd-devel] Started process not attach to its related service.

2016-11-23 Thread Benoit SCHMID
Hello,

On 11/22/2016 11:46 AM, Holger Kiehl wrote:
> But users do test things under their login environment and expect them
> to run in this environment. So for some applications this is a must.
I fully agree with you.

I am a SAP admin.

As far as SAP is concerned, to manage the service, the procedure is
to issue sidadm user and start commands with different arguments
from this shell user.

I am not saying that it is the best way to do :-)
I am just saying it is the way SAP works on all its Unix OS.
This is why it is convenient to use su even if it has drawbacks.

On the other hand saying stop using su on your start/stop script
is a limitation that I also find too strong.

Anyway thanks for all the ones who provided help and provided alternatives.
I have not yet tested runuser and EnvironmentFile...

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] Started process not attach to its related service.

2016-11-22 Thread Benoit SCHMID
Hello,

On 11/22/2016 10:58 AM, Jonathan de Boyne Pollard wrote:
>
> It's now 2016, and the first rule for migrating to systemd applies
> even to Oracle softwares.
>
> * http://jdebp.eu./FGA/systemd-house-of-horror/daemonize.html#first-rule
>
> * http://www.server-world.info/en/note?os=CentOS_7=oracle12c=6
>
> *
> https://lists.freedesktop.org/archives/systemd-devel/2014-October/thread.html#24663
>
> * https://www.realdbamagic.com/automatic-db-startup-linux-part-oel-6-7-2/
>

Even if we are in 2016, I have migrated a SAP system running on Oracle.
This not only a Oracle DB.

Everything worked fine on RH6 with system V.
On RH7 I am loosing several days try to understand
why systemd kills my process before I have the chance
to stop them on my own :-(

Finding out why it behaves like this is really not trivial, at least for me.
If there is an easy way to why I have such behaviour do not hesitate to
provide me the solution.
I will offer you a coffe next time you go to Geneva.

You have provided example of systemd config for Oracle DB.
If you have systemd configurations to start/stop a SAP system running on
Oracle DB,
please provide them to me.
I am very interesting.

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-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] Script in /usr/lib/systemd/system-shutdown not executed on init 6

2016-11-23 Thread Benoit SCHMID
Hello,

On 11/23/2016 11:55 AM, Lennart Poettering wrote:
> The scripts dropped there are executed very late during the shutdown
> process at a time where all processes have already been killed and all
> mount points have been unmounted or at least remounted
> read-only.

Is there an easy way to create a systemd service that would be stopped
very early
at the shutdown and would avoid the other services stop command to be
executed.

In other world, on my XXX server, the most important service is XXX.
Stopping XXX takes time (~1 min per XXX system).

Therefore, in case of init 6, I would like to stopxxx
When stopxxx finishes or timeouts then systemd
could start stopping the other services.

Is there an easier way than trying After= and Before= options?

Thanks for the time you have taken to answer my questions.

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

 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] Script in /usr/lib/systemd/system-shutdown not executed on init 6

2016-11-23 Thread Benoit SCHMID
Hello,

On 11/23/2016 03:03 PM, Reindl Harald wrote:
> than you need only to adjust "DefaultTimeoutStopSec" to ensure it does
> not get killed and order services proper 

In most of my tests, this is set to 5min.
Therefore the problem is not located on the fact that the stop command
ends too early.

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] systemd-sysv-generator bug ?

2016-11-22 Thread Benoit SCHMID
Hello,

On 11/22/2016 09:15 AM, Andrei Borzenkov wrote:
> Mount units are also propagated to systemd user instance. So you
> probably can also run this unit in systemd user context and have usual
> dependencies on filesystems (like RequiresMountsFor) - at least, I
> think so :) You will need to enable lingering then as mentioned
> already. User instances are stopped on shutdown too.

Do you mean that adding "After=user.slice" would also prevent systemd to
unmount
fs before my stop command is finished?

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] systemd-sysv-generator bug ?

2016-11-22 Thread Benoit SCHMID
Hello,

On 11/22/2016 10:25 AM, Andrei Borzenkov wrote:
> I do not think so, unless you have explicit dependencies on mount
> points (they are commented out in your link). If you do have explicit
> dependencies, I expect this to work too.
Even, when the line is uncommented, the umounts are performed.
How can I diagnose why it is unmounted before my stop script ends?

As these filesystem are local in my /etc/fstab, do you agree that
"After=local-fs.target"
should be enough to avoid unmounting before my stopexec finishes?

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] systemd-sysv-generator bug ?

2016-11-22 Thread Benoit SCHMID
Hello,

On 11/22/2016 09:15 AM, Andrei Borzenkov wrote:
> Assuming that your command survives normal session exit - does adding
> "After=user.slice" to your service helps? This should ensure your
> service is stopped before any user processes.

With "After=system.slice local-fs.target network-online.target
systemd-journald.socket user.slice basic.target",
my process is still killed by systemd before my stop script is started.

This is my process status, before running init 6:

 CGroup: /
   ├─1 /usr/lib/systemd/systemd --switched-root --system
--deserialize 2
   ├─user.slice
   │ ├─user-0.slice
   │ │ └─session-2.scope
   │ │   ├─15483 sshd: root@pts/0
   │ │   ├─15485 -bash
   │ │   ├─15783 /usr/bin/perl /usr/local/bin/write-sysv-test.pl
   │ │   ├─15800 systemctl status
   │ │   └─15801 less

# systemctl status sysv-test.service
● sysv-test.service - sysv-test
   Loaded: loaded (/etc/systemd/system/sysv-test.service; enabled;
vendor preset: disabled)
   Active: active (exited) since Tue 2016-11-22 10:18:39 CET; 12min ago
  Process: 13688 ExecStart=/usr/bin/true (code=exited, status=0/SUCCESS)
 Main PID: 13688 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/sysv-test.service

Nov 22 10:18:39 spinelle1 systemd[1]: Started sysv-test.
Nov 22 10:18:39 spinelle1 systemd[1]: Starting sysv-test...

# systemctl show sysv-test.service | grep -i after
RemainAfterExit=yes
After=system.slice local-fs.target network-online.target
systemd-journald.socket user.slice basic.target

Would you know why it is still killed before running my stop script?

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] Started process not attach to its related service.

2016-11-22 Thread Benoit SCHMID
Hello,

I have tried with
"User=oracle","Environment=ORACLE_HOME=/oracle/XXX/12102" and removing
the "su -".
You are right.
Now I have:

# systemctl status ora_lsnr_XXX.service
● ora_lsnr_XXX.service - Oracle Listener XXX
   Loaded: loaded (/etc/systemd/system/ora_lsnr_XXX.service; disabled;
vendor preset: disabled)
   Active: active (running) since Tue 2016-11-22 11:49:13 CET; 5min ago
  Process: 22841 ExecStart=/oracle/XXX/12102/bin/lsnrctl start
LISTENER_XXX (code=exited, status=0/SUCCESS)
 Main PID: 22843 (tnslsnr)
   CGroup: /system.slice/ora_lsnr_XXX.service
   └─22843 /oracle/XXX/12102/bin/tnslsnr LISTENER_XXX -inherit

Thanks for you help on this point.


On 11/22/2016 10:29 AM, Andrei Borzenkov wrote:
> On Tue, Nov 22, 2016 at 11:39 AM, Benoit SCHMID <benoit.sch...@unige.ch> 
> wrote:
> ...
>> 2. This service starts /etc/rc.d/init.d/sap start.
>> % cat /etc/rc.d/init.d/sap
>> #!/bin/bash
>> ...
>> case "$1" in
>> start)
>> # Oracle listener and instance startup
>> echo -n "Starting Oracle Listener: "
>> su - $ORA_OWNR -c "env ORACLE_HOME=/oracle/XXX/12102
>> /oracle/XXX/12102/bin/lsnrctl start LISTENER_XXX"
> ...
>> Why is the processed attached to user-.slice instead of sap?
> Because "su" opens new session with logind, so everything it does
> belongs to this user session. You should really use proper systemd
> unit and set User and Group for it instead.

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

 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] Started process not attach to its related service.

2016-11-22 Thread Benoit SCHMID
Good morning,

This topic is related to the systemd-sysv-generator thread submited by
my colleague.
I post it with another subject becaus I prefer to create another thread
as it would make too many different questions in the same thread.

1. I have defined a service.
It is started by systemd on boot:
# systemctl status sap
● sap.service - SYSV: Startup/Shutdown SAP and Oracle Listener
   Loaded: loaded (/etc/rc.d/init.d/sap; bad; vendor preset: disabled)
   Active: active (exited) since Tue 2016-11-22 09:22:23 CET; 3min 7s ago
 Docs: man:systemd-sysv-generator(8)
  Process: 14124 ExecStart=/etc/rc.d/init.d/sap start (code=exited,
status=0/SUCCESS)

2. This service starts /etc/rc.d/init.d/sap start.
% cat /etc/rc.d/init.d/sap
#!/bin/bash
...
case "$1" in
start)
# Oracle listener and instance startup
echo -n "Starting Oracle Listener: "
su - $ORA_OWNR -c "env ORACLE_HOME=/oracle/XXX/12102
/oracle/XXX/12102/bin/lsnrctl start LISTENER_XXX"
touch /var/lock/subsys/sap
echo "OK"
;;
...

3. The desired process is correctly started:
# ps -ef | grep -i lsnr
oracle   14955 1  0 09:22 ?00:00:00
/oracle/XXX/12102/bin/tnslsnr LISTENER_XXX -inherit

4. But this process is not attached to sap service.
It is attached to the user-
   CGroup: /
   ├─1 /usr/lib/systemd/systemd --switched-root --system
--deserialize 2
   ├─user.slice
...
   │ └─user-.slice
   │   └─session-c2.scope
   │ └─14955 /oracle/XXX/12102/bin/tnslsnr LISTENER_XXX -inherit
...

Why is the processed attached to user-.slice instead of sap?
Why has sap no attached process to it?

Thanks in advance for your answers.

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

 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] Started process not attach to its related service.

2016-11-22 Thread Benoit SCHMID
Hello,

On 11/22/2016 10:58 AM, Jonathan de Boyne Pollard wrote:
> Don't abuse su for dropping privileges. 

I agree that using su has drawbacks.

But it also have advantages.
When you upgrade your db, you upgrade the environment variables.
Therefore using su allow you to centralised everything in one place
(user settings).

This is why, after thinking of the pros and cons, I use su,
even if I agree with you, on the fact that should not abuse :-)

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] Script in /usr/lib/systemd/system-shutdown not executed on init 6

2016-11-24 Thread Benoit SCHMID
Hello,

On 11/23/2016 03:52 PM, Reindl Harald wrote:
> so why do you strip the whole context and rest of the response?
>
> what  is your exactly problem?
>
I think my original question on this thread is clear.
> it should be no rocket science to define a service, order starting as
> needed which ensures at the same time that stop services happens in
> the exactly reverse order
>
It is more than rocket science to have the same behaviour
for my SAP system behaviour on RH7 like on RH6.
On RH6 I could boot my server.
Then a few days after I could manually restart dedicated processes.
On the next shutdown, I knew my processes would be cleanly stopped.

With RH7, my commands' executions need to be wrapped by systemd service.
Otherwise, as L. Poettering said, these daemons are not stopped cleanly
at shutdown.
This what I have understood.

> maybe you should stop looking at old sysv scripts and just start from
> scratch and define what you need in a proper systemd unit - for many
> things you will find out that a lot of magic from init scripts is not
> needed at all
>
This is what I am trying to do :-)

> for me it ssems what you trying to to is wrap everything from a init
> script in a native systemd-unit which is wrong from the start in most
> cases 
"trying to wrap everything from init script" is not my overall goal.
My over goal is to administer my SAP systems on my new RH7 servers.

I have constraints from RH7 and from SAP and from Oracle DB.
After reading that there is systemv systemd generator,
I thought that I could have all the old functionalities with systemd.
It is not the case.
Therefore I am trying to find the best compromises to run my SAP systems.
This implies understanding what I can do and what I cannot do with systemd.
This is why I ask questions like the one on this thread.

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] Started process not attach to its related service.

2016-11-24 Thread Benoit SCHMID
Hello,

On 11/23/2016 07:26 PM, Andrei Borzenkov wrote:
> Recent (for suitable definition of "recent") SAP releases are using
> sapcontrol framework to start/stop SAP services. So start startsap
> actually does, is to make remote procedure call to sapstartsrv which
> then starts SAP instance processes. So as long as startsapsrv itself is
> launched as separate service, your problem should not happen. This may
> offer suitable workaround.

You are reporting a useful point.

I can not do all my Oracle DB and SAP administration with sapstartsrv.
But this can cover a big part of the job as this daemon stay alive
even when a whole SAP instance is stopped.
I have to test how sapstartsrv preserve cgroup.

Thanks a lot for pointing out this :-)

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

 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] Script in /usr/lib/systemd/system-shutdown not executed on init 6

2016-11-24 Thread Benoit SCHMID
Hello,

On 11/24/2016 12:22 AM, Lennart Poettering wrote:
> In general, while systemd provides a large degree of SysV compat, in
> the end we aren't SysV and thus we do not provide 100%. In cases like
> this this becomes visible.

You are 100% right :-)

Right after upgrading my first server,
I wrongly assumed that systemv scripts
could be migrated easily.
I was wrong.

Thanks for all the feedbacks you have provided.

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

     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 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


[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] after=local-fs not enforced

2016-11-24 Thread 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

# systemctl --version
systemd 219

Thanks 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 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