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

Andrei Borzenkov arvidjaar at gmail.com
Tue Nov 22 09:29:41 UTC 2016


On Tue, Nov 22, 2016 at 11:39 AM, Benoit SCHMID <Benoit.Schmid at 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-xxxx.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.


More information about the systemd-devel mailing list