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&p=oracle12c&f=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


[systemd-devel] Script in /usr/lib/systemd/system-shutdown not executed on init 6

2016-11-22 Thread Benoit SCHMID
Hello,

I have added a simple script in /usr/lib/systemd/system-shutdown.
The scripts echo a message (on stdout) and create a file in /var/tmp.
I manually tested the script before rebooting to ensure that it works fine.

After running init 6, there is no message in journactl -b -1 and the
file has not been created.

1. How can I ensure that it has not been started after running init 6?

2. Why has it not been started?

3. If it should have been started,
how can I diagnose/debug why it has not been started?

Thanks in advance for your help.

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

 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] Promoting a pull request

2016-11-22 Thread Zbigniew Jędrzejewski-Szmek
On Tue, Nov 22, 2016 at 12:02:41PM +0100, Jouke Witteveen wrote:
> On Tue, Nov 22, 2016 at 11:55 AM, Martin Pitt  wrote:
> > Jouke Witteveen [2016-11-22 11:44 +0100]:
> >> I see no way of (trying to) removing the reviewed/needs-rework label
> >> in the PR interface.
> >
> > I click on the cog next to "Labels" on the right, there I can "untick"
> > labels. I've done so for #4259.
> 
> Thanks, Martin!
> 
> > So maybe it's just UI obfuscation, but perhaps label setting/removing
> > is limited to project members?
> 
> I would guess it is. I can assign labels to my own projects, but not
> to e.g. systemd. I would say this makes sense, but it leaves something
> to be desired for contributing.

https://github.com/systemd/systemd/pull/4716

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


Re: [systemd-devel] Promoting a pull request

2016-11-22 Thread Zbigniew Jędrzejewski-Szmek
On Tue, Nov 22, 2016 at 01:07:51PM +0100, Lennart Poettering wrote:
> On Tue, 22.11.16 11:44, Jouke Witteveen (j.wittev...@gmail.com) wrote:
> 
> > The contribution guidelines [1] state:
> > 
> > > After you have pushed a new version, try to remove the
> > > reviewed/needs-rework label. Also add a comment about the new version
> > > (no notification is sent just for the commits, so it's easy to miss the
> > > update without an explicit comment).
> > 
> > I see no way of (trying to) removing the reviewed/needs-rework label
> > in the PR interface. I feel that as a result, my PR (#4259) has fallen
> > off the radar. Is there anything I can do to sponsor my PR? I am still
> > interested in seeing it merged.
> > 
> > If it is indeed impossible to do anything with the assigned labels,
> > maybe the quoted part of the contibution guidelines should be updated.
> 
> I usually get notified by github if people comment on github, but
> there are no notifications if labels change or you update a
> branch. Hence: to make sure your updates are noticed, always also add
> a comment to the PR, otherwise it will never show up as "changed" in
> the PR list...
> 
> Yeah, github UI sucks in this regard... Simply keep in mind to also
> write one comment each time you update a PR branch!

... and also feel free to ping (by commenting on the PR again) after
some time. Things do fall by the wayside occasionally.

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


Re: [systemd-devel] accelerometer mount-matrix quirks

2016-11-22 Thread Thomas H.P. Andersen
On Tue, Nov 22, 2016 at 5:26 PM, Bastien Nocera  wrote:

> On Tue, 2016-11-22 at 17:23 +0100, Lennart Poettering wrote:
> > On Tue, 22.11.16 12:13, Bastien Nocera (had...@hadess.net) wrote:
> >
> > > Hey,
> > >
> > > I'm adding support for reading the mount-matrix[1] from
> > > accelerometer
> > > devices in iio-sensor-proxy, but we'll need to add a way to
> > > override
> > > the mount-matrix in case the data from the device-tree is
> > > incorrect, or
> > > missing[2].
> > >
> > > I was wondering whether we should ship the hwdb quirks in systemd
> > > or
> > > iio-sensor-proxy.
> > >
> > > Opinions?
> >
> > If it's generic enough then the hwdb is definitely a good place for
> > things like that. If the concept however only has value for
> > iio-sensor-proxy specifically then it should probably live in that
> > package. Of course the lines are blurry there, so compare with the
> > input case: hwdb carries dpi quirk data for all kinds of mice, and if
> > this data is like that, then it fits in.
>
> The quirks apply to the devices, and are in the same format as what's
> offered by the kernel when the firmware provides it, so it's not iio-
> sensor-proxy specific in any way. If we were to replace iio-sensor-
> proxy, we'd still use this metadata.
>
> I'll send a patch in as soon as I've done testing on a machine that
> does need this quirking.
>

Hi Bastien,

I recently opened a PR to iio-sensor-proxy with a quirk for my laptop.
Since this is my main computer testing is easy. Let me know if I can help.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-networkd: broken network in container

2016-11-22 Thread arnaud gaboury
On Tue, Nov 22, 2016 at 4:54 PM arnaud gaboury 
wrote:

> Since a few days, after some upgrades, I don't have anymore network in my
> container. Network is OK on my host
>
> ---
> Host: Archlinux -
> % systemctl --version
> systemd 231
> +PAM -AUDIT -SELINUX -IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP
> +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN
>
> Container: Fedora 24 -
> % systemctl --version
> systemd 229
> +PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP
> +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN
> --
>
> Looking at journalctl on host, I found these errors:
>
> Nov 22 13:47:54 hortensia systemd-networkd[2777]: br0: Could not append
> VLANs: Operation not permitted
> Nov 22 13:47:54 hortensia systemd-networkd[2777]: br0: Failed to assign
> VLANs to bridge port: Operation not permitted
> Nov 22 13:47:54 hortensia systemd-networkd[2777]: br0: Could not set
> bridge vlan: Operation not permitted
> Nov 22 13:47:54 hortensia systemd-networkd[2777]: enp7s0: IPv6 disabled
> for interface: Success
> Nov 22 13:47:55 hortensia systemd-networkd[2777]: enp7s0: Could not append
> VLANs: Operation not permitted
> Nov 22 13:47:55 hortensia systemd-networkd[2777]: enp7s0: Failed to assign
> VLANs to bridge port: Operation not permitted
> Nov 22 13:47:55 hortensia systemd-networkd[2777]: enp7s0: Could not set
> bridge vlan: Operation not permitted
> Nov 22 13:47:55 hortensia systemd[1]: Started Network Service.
> 
>
> Googling these above lines brings me to this issue: #3876[0]
>
> Any progress on it? I can't see where these errors come from. Any hint or
> dirty hack ?
>

EDIT:

This post[1] gave me the answer. Sad it was already post by me a few months
ago ! I just forgot to make permanent the change to the unit file. So when
I upgrade systemd (a few days ago), the wrong setting came back.
Now I edited the unit file and wrote a unitfile.d/override.conf file, so
change will survive next upgrade :-)

Sorry for the noise.

[1]
https://lists.freedesktop.org/archives/systemd-devel/2016-August/037317.html


> [0]https://github.com/systemd/systemd/issues/3876
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] after=user.slice not enforced

2016-11-22 Thread Lennart Poettering
On Tue, 22.11.16 16:53, Cédric BRINER (cedric.bri...@unige.ch) wrote:

> Hi,
> 
> sapRunning service contains a "After=user.slice". But at the shutdown, a
> process (write-sysv-test.pl) running in user.slice is killed before the
> end of the sapRunning's stop.

Slices are a concept for resource management, and that's what they
should be used for. Do not user them for anything else, such as
ordering purposes.

In systemd shutdown ordering is the inverse of start-up ordering, and
After= and Before= declare the latter. This means that if your service
has After=user.slice, this means at shutdown your service will be
stopped first and user.slice second.

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] accelerometer mount-matrix quirks

2016-11-22 Thread Bastien Nocera
On Tue, 2016-11-22 at 17:23 +0100, Lennart Poettering wrote:
> On Tue, 22.11.16 12:13, Bastien Nocera (had...@hadess.net) wrote:
> 
> > Hey,
> > 
> > I'm adding support for reading the mount-matrix[1] from
> > accelerometer
> > devices in iio-sensor-proxy, but we'll need to add a way to
> > override
> > the mount-matrix in case the data from the device-tree is
> > incorrect, or
> > missing[2].
> > 
> > I was wondering whether we should ship the hwdb quirks in systemd
> > or
> > iio-sensor-proxy.
> > 
> > Opinions?
> 
> If it's generic enough then the hwdb is definitely a good place for
> things like that. If the concept however only has value for
> iio-sensor-proxy specifically then it should probably live in that
> package. Of course the lines are blurry there, so compare with the
> input case: hwdb carries dpi quirk data for all kinds of mice, and if
> this data is like that, then it fits in.

The quirks apply to the devices, and are in the same format as what's
offered by the kernel when the firmware provides it, so it's not iio-
sensor-proxy specific in any way. If we were to replace iio-sensor-
proxy, we'd still use this metadata.

I'll send a patch in as soon as I've done testing on a machine that
does need this quirking.

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


Re: [systemd-devel] Missing previous boot system journal

2016-11-22 Thread Lennart Poettering
On Tue, 22.11.16 23:52, Yun-Chih Chen (yunchih@gmail.com) wrote:

> I've explicitly enabled persistent storage in journald.conf.  However, it
> seems that the system journal of previous boot is still missing; only some
> user journal persisted.  Am I missing anything?  Thanks in advance.

You are apparently running the journalctl commands unprivileged. Do
things work if you run this as root?


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-networkd: broken network in container

2016-11-22 Thread Lennart Poettering
On Tue, 22.11.16 15:54, arnaud gaboury (arnaud.gabo...@gmail.com) wrote:

> Since a few days, after some upgrades, I don't have anymore network in my
> container. Network is OK on my host
> 
> ---
> Host: Archlinux -
> % systemctl --version
> systemd 231
> +PAM -AUDIT -SELINUX -IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP
> +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN
> 
> Container: Fedora 24 -
> % systemctl --version
> systemd 229
> +PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP
> +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN
> --
> 
> Looking at journalctl on host, I found these errors:
> 
> Nov 22 13:47:54 hortensia systemd-networkd[2777]: br0: Could not append
> VLANs: Operation not permitted
> Nov 22 13:47:54 hortensia systemd-networkd[2777]: br0: Failed to assign
> VLANs to bridge port: Operation not permitted
> Nov 22 13:47:54 hortensia systemd-networkd[2777]: br0: Could not set bridge
> vlan: Operation not permitted
> Nov 22 13:47:54 hortensia systemd-networkd[2777]: enp7s0: IPv6 disabled for
> interface: Success
> Nov 22 13:47:55 hortensia systemd-networkd[2777]: enp7s0: Could not append
> VLANs: Operation not permitted
> Nov 22 13:47:55 hortensia systemd-networkd[2777]: enp7s0: Failed to assign
> VLANs to bridge port: Operation not permitted
> Nov 22 13:47:55 hortensia systemd-networkd[2777]: enp7s0: Could not set
> bridge vlan: Operation not permitted
> Nov 22 13:47:55 hortensia systemd[1]: Started Network Service.
> 
> 
> Googling these above lines brings me to this issue: #3876[0]
> 
> Any progress on it? I can't see where these errors come from. Any hint or
> dirty hack ?
> 
> [0]https://github.com/systemd/systemd/issues/3876

That issue has been closed via:

https://github.com/systemd/systemd/pull/3892

Please make sure to tun a version including at least that.

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] accelerometer mount-matrix quirks

2016-11-22 Thread Lennart Poettering
On Tue, 22.11.16 12:13, Bastien Nocera (had...@hadess.net) wrote:

> Hey,
> 
> I'm adding support for reading the mount-matrix[1] from accelerometer
> devices in iio-sensor-proxy, but we'll need to add a way to override
> the mount-matrix in case the data from the device-tree is incorrect, or
> missing[2].
> 
> I was wondering whether we should ship the hwdb quirks in systemd or
> iio-sensor-proxy.
> 
> Opinions?

If it's generic enough then the hwdb is definitely a good place for
things like that. If the concept however only has value for
iio-sensor-proxy specifically then it should probably live in that
package. Of course the lines are blurry there, so compare with the
input case: hwdb carries dpi quirk data for all kinds of mice, and if
this data is like that, then it fits in.

Lennart

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


[systemd-devel] systemd-networkd: broken network in container

2016-11-22 Thread arnaud gaboury
Since a few days, after some upgrades, I don't have anymore network in my
container. Network is OK on my host

---
Host: Archlinux -
% systemctl --version
systemd 231
+PAM -AUDIT -SELINUX -IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP
+GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN

Container: Fedora 24 -
% systemctl --version
systemd 229
+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP
+GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN
--

Looking at journalctl on host, I found these errors:

Nov 22 13:47:54 hortensia systemd-networkd[2777]: br0: Could not append
VLANs: Operation not permitted
Nov 22 13:47:54 hortensia systemd-networkd[2777]: br0: Failed to assign
VLANs to bridge port: Operation not permitted
Nov 22 13:47:54 hortensia systemd-networkd[2777]: br0: Could not set bridge
vlan: Operation not permitted
Nov 22 13:47:54 hortensia systemd-networkd[2777]: enp7s0: IPv6 disabled for
interface: Success
Nov 22 13:47:55 hortensia systemd-networkd[2777]: enp7s0: Could not append
VLANs: Operation not permitted
Nov 22 13:47:55 hortensia systemd-networkd[2777]: enp7s0: Failed to assign
VLANs to bridge port: Operation not permitted
Nov 22 13:47:55 hortensia systemd-networkd[2777]: enp7s0: Could not set
bridge vlan: Operation not permitted
Nov 22 13:47:55 hortensia systemd[1]: Started Network Service.


Googling these above lines brings me to this issue: #3876[0]

Any progress on it? I can't see where these errors come from. Any hint or
dirty hack ?

[0]https://github.com/systemd/systemd/issues/3876
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] after=user.slice not enforced

2016-11-22 Thread Cédric BRINER
Hi,

sapRunning service contains a "After=user.slice". But at the shutdown, a
process (write-sysv-test.pl) running in user.slice is killed before the
end of the sapRunning's stop.

# cat sapRunning.service
[Unit]
Description=SAP Service to ensure stopsap during shutdown
After=local-fs.target network-online.target remote-fs.target user.slice
ora_lsnr_DEV.service

[Service]
ExecStart=/usr/local/bin/sapRunning
ExecStop=/usr/local/bin/stop-sapRunning
Restart=no
TimeoutStopSec=5min

[Install]
WantedBy=multi-user.target

# systemctl status
 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...


So what did we missed so that the verb stop of sapRunning.service can
not see this write-sysv-test.pl anymore ?

Regards.


cED
-- 
Cédric BRINER, Ing. EPFL & HES
+41 (0)22 / 379 71 83
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Missing previous boot system journal

2016-11-22 Thread Yun-Chih Chen
I've explicitly enabled persistent storage in journald.conf.  However, it
seems that the system journal of previous boot is still missing; only some
user journal persisted.  Am I missing anything?  Thanks in advance.

I'm running on Archlinux with Linux 4.8.4 and systemd 231-4.

Here's some output:

$ journalctl -b -1 -k

-- No entries --

$ journalctl -b -1
-- Logs begin at Fri 2016-02-05 00:16:50 CST, end at Tue 2016-11-22
23:35:47 CST. --
Nov 09 08:27:14 server systemd[19336]: Reached target Timers.
Nov 09 08:27:14 server systemd[19336]: Listening on Sound System.
Nov 09 08:27:14 server systemd[19336]: Starting D-Bus User Message Bus
Socket.
Nov 09 08:27:14 server systemd[19336]: Reached target Paths.
Nov 09 08:27:14 server systemd[19336]: Listening on D-Bus User Message Bus
Socket.
Nov 09 08:27:14 server systemd[19336]: Reached target Sockets.
Nov 09 08:27:14 server systemd[19336]: Reached target Basic System.
Nov 09 08:27:14 server systemd[19336]: Starting Update XDG user dir
configuration...
Nov 09 08:27:14 server systemd[19336]: Started Update XDG user dir
configuration.
Nov 09 08:27:14 server systemd[19336]: Reached target Default.
Nov 09 08:27:14 server systemd[19336]: Startup finished in 124ms.
Nov 09 08:53:57 server systemd[19336]: Stopped target Default.
Nov 09 08:53:57 server systemd[19336]: Stopped target Basic System.
Nov 09 08:53:57 server systemd[19336]: Stopped target Paths.
Nov 09 08:53:57 server systemd[19336]: Stopped target Timers.
Nov 09 08:53:57 server systemd[19336]: Stopped target Sockets.
Nov 09 08:53:57 server systemd[19336]: Closed D-Bus User Message Bus Socket.
Nov 09 08:53:57 server systemd[19336]: Closed Sound System.
Nov 09 08:53:57 server systemd[19336]: Reached target Shutdown.
Nov 09 08:53:58 server systemd[19336]: Starting Exit the Session...
Nov 09 08:53:58 server systemd[19336]: Received SIGRTMIN+24 from PID 6632
(kill).
Nov 09 08:58:54 server systemd[8229]: Reached target Timers.
Nov 09 08:58:54 server systemd[8229]: Reached target Paths.
Nov 09 08:58:54 server systemd[8229]: Starting D-Bus User Message Bus
Socket.
Nov 09 08:58:54 server systemd[8229]: Listening on Sound System.

// There's only one system.journal file under /var/log/journal
$ ls /var/log/journal/65f854e19e1d43049c5e058f1f93648f | tail
-rw-r-+ 1 root systemd-journal  8388608 Nov 22 22:21 user-30130.journal
-rw-r-+ 1 root systemd-journal  8388608 Nov 22 22:46 user-66461.journal
-rw-r-+ 1 root systemd-journal  8388608 Nov 22 22:46 user-66401.journal
-rw-r-+ 1 root systemd-journal  8388608 Nov 22 22:56 user-66358.journal
-rw-r-+ 1 root systemd-journal  8388608 Nov 22 23:27 user-1000.journal
-rw-r-+ 1 root systemd-journal  8388608 Nov 22 23:32 user-66704.journal
-rw-r-+ 1 root systemd-journal 25165824 Nov 22 23:37 user-1.journal
-rw-r-+ 1 root systemd-journal  8388608 Nov 22 23:37 user-65979.journal
-rw-r-+ 1 root systemd-journal 16777216 Nov 22 23:37 system.journal

$ journalctl --list-boots

-6 8d87ad64bd304262a3fb7dd168e5b281 Fri 2016-02-05 00:16:50 CST—Fri
2016-02-05 01:00:15 CST
-5 f23f466ad9b14b99ae32df044cb99f5f Sun 2016-04-24 15:29:21 CST—Sat
2016-04-30 10:01:31 CST
-4 d834ef74d7504da0a10389581de5521a Sun 2016-06-19 14:02:16 CST—Sat
2016-07-09 10:01:31 CST
-3 940aeff685804fe193f4e4e767234c24 Mon 2016-07-25 08:06:07 CST—Sat
2016-08-06 07:00:25 CST
-2 fa52bc6f582b4df083e57863e000ffad Thu 2016-09-29 18:04:51 CST—Tue
2016-10-25 23:59:19 CST
-1 2815d7f541644e9a8a9d778f1c69838e Wed 2016-11-09 08:27:18 CST—Mon
2016-11-21 17:57:41 CST
 0 0ab0d3a3955241e9b16b22674046cea7 Tue 2016-11-22 21:15:26 CST—Tue
2016-11-22 23:40:28 CST


Here's the content of /etc/systemd/journald.conf:

[Journal]
Storage=persistent
#Compress=yes
#Seal=yes
#SplitMode=uid
#SyncIntervalSec=5m
#RateLimitIntervalSec=30s
#RateLimitBurst=1000
#SystemMaxUse=
#SystemKeepFree=
#SystemMaxFileSize=
#SystemMaxFiles=100
#RuntimeMaxUse=
#RuntimeKeepFree=
#RuntimeMaxFileSize=
#RuntimeMaxFiles=100
#MaxRetentionSec=
#MaxFileSec=1month
#ForwardToSyslog=no
#ForwardToKMsg=no
#ForwardToConsole=no
#ForwardToWall=yes
#TTYPath=/dev/console
#MaxLevelStore=debug
#MaxLevelSyslog=debug
#MaxLevelKMsg=notice
#MaxLevelConsole=info
#MaxLevelWall=emerg

-- 
I send this mail for the second time since it seems to fail previously.
Please ignore this if you find it a duplicate. ( :
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Semantics of struct Manager.mdns_support in systemd-resolved

2016-11-22 Thread Dmitry Rozhkov
Hi!

What's the plan for the struct Manager.mdns_support field in systemd-
resolved? Currently it's set to RESOVE_SUPPORT_NO always and never gets
updated regardless of the MulticastDNS= settings for network links?
Still it's checked in the function manager_mdns_start() of
resolve/resolved-mdns.c and that results into never starting mDNS
manager.

Is it supposed to be a global override for link-specific MulticastDNS=
settings or some redundant caching field reflecting the combined state
of the network links?

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


[systemd-devel] accelerometer mount-matrix quirks

2016-11-22 Thread Bastien Nocera
Hey,

I'm adding support for reading the mount-matrix[1] from accelerometer
devices in iio-sensor-proxy, but we'll need to add a way to override
the mount-matrix in case the data from the device-tree is incorrect, or
missing[2].

I was wondering whether we should ship the hwdb quirks in systemd or
iio-sensor-proxy.

Opinions?

Cheers

[1]: 
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=dfc57732ad38f93ae6232a3b4e64fd077383a0f1
[2]: ACPI exports it as well, but it's not available from the kernel:
http://marc.info/?l=linux-iio&m=147981183211362&w=2
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Promoting a pull request

2016-11-22 Thread Lennart Poettering
On Tue, 22.11.16 11:44, Jouke Witteveen (j.wittev...@gmail.com) wrote:

> The contribution guidelines [1] state:
> 
> > After you have pushed a new version, try to remove the
> > reviewed/needs-rework label. Also add a comment about the new version
> > (no notification is sent just for the commits, so it's easy to miss the
> > update without an explicit comment).
> 
> I see no way of (trying to) removing the reviewed/needs-rework label
> in the PR interface. I feel that as a result, my PR (#4259) has fallen
> off the radar. Is there anything I can do to sponsor my PR? I am still
> interested in seeing it merged.
> 
> If it is indeed impossible to do anything with the assigned labels,
> maybe the quoted part of the contibution guidelines should be updated.

I usually get notified by github if people comment on github, but
there are no notifications if labels change or you update a
branch. Hence: to make sure your updates are noticed, always also add
a comment to the PR, otherwise it will never show up as "changed" in
the PR list...

Yeah, github UI sucks in this regard... Simply keep in mind to also
write one comment each time you update a PR branch!

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

2016-11-22 Thread Lennart Poettering
On Tue, 22.11.16 09:39, Benoit SCHMID (benoit.sch...@unige.ch) wrote:

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

You are using "su" to change users here. "su" does considerably more
than that though: it opens a new login session. Use util-linux'
"setpriv" which is the tool to use if all you want to do is drop
privs...

That said, I'd always recommend stopping using SysV services all together.

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] Promoting a pull request

2016-11-22 Thread Jouke Witteveen
On Tue, Nov 22, 2016 at 11:55 AM, Martin Pitt  wrote:
> Jouke Witteveen [2016-11-22 11:44 +0100]:
>> I see no way of (trying to) removing the reviewed/needs-rework label
>> in the PR interface.
>
> I click on the cog next to "Labels" on the right, there I can "untick"
> labels. I've done so for #4259.

Thanks, Martin!

> So maybe it's just UI obfuscation, but perhaps label setting/removing
> is limited to project members?

I would guess it is. I can assign labels to my own projects, but not
to e.g. systemd. I would say this makes sense, but it leaves something
to be desired for contributing.

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


Re: [systemd-devel] Promoting a pull request

2016-11-22 Thread Martin Pitt
Hello Jouke,

Jouke Witteveen [2016-11-22 11:44 +0100]:
> I see no way of (trying to) removing the reviewed/needs-rework label
> in the PR interface.

I click on the cog next to "Labels" on the right, there I can "untick"
labels. I've done so for #4259.

So maybe it's just UI obfuscation, but perhaps label setting/removing
is limited to project members?

Martin

-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
___
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  
> 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] Promoting a pull request

2016-11-22 Thread Jouke Witteveen
The contribution guidelines [1] state:

> After you have pushed a new version, try to remove the
> reviewed/needs-rework label. Also add a comment about the new version
> (no notification is sent just for the commits, so it's easy to miss the
> update without an explicit comment).

I see no way of (trying to) removing the reviewed/needs-rework label
in the PR interface. I feel that as a result, my PR (#4259) has fallen
off the radar. Is there anything I can do to sponsor my PR? I am still
interested in seeing it merged.

If it is indeed impossible to do anything with the assigned labels,
maybe the quoted part of the contibution guidelines should be updated.

Regards,
- Jouke

[1] https://github.com/systemd/systemd/blob/master/.github/CONTRIBUTING.md
___
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 Holger Kiehl
On Tue, 22 Nov 2016, Mantas Mikulėnas wrote:

> So, uh, that sounded like you value updating one file less (and even mixing
> user and daemon configs) above having the service actually work?
>
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.

> Not that it's an excuse anyway. Systemd units have EnvironmentFile= for
> importing environment variables. Even init.d scripts can use `source` with
> the same effect, as can users' own .profile or .foorc scripts... There are
> plenty of nice ways to "share environment variables" without using su.
> 
Users have different shell's and even distributions name them differently
(.profile, .bash_profile). With EnvironmentFile= you force the user to put
the same things at two different places. With su you do not have to
think about all these problems.

Regards,
Holger

> That said, at least try `runuser`...
> 
> On Tue, Nov 22, 2016, 12:07 Benoit SCHMID  wrote:
>   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
> 
> 
> ___
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 Mantas Mikulėnas
So, uh, that sounded like you value updating one file less (and even mixing
user and daemon configs) above having the service actually work?

Not that it's an excuse anyway. Systemd units have EnvironmentFile= for
importing environment variables. Even init.d scripts can use `source` with
the same effect, as can users' own .profile or .foorc scripts... There are
plenty of nice ways to "share environment variables" without using su.

That said, at least try `runuser`...

On Tue, Nov 22, 2016, 12:07 Benoit SCHMID  wrote:

> 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
>
___
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 Jonathan de Boyne Pollard

Benoit SCHMID:

 echo -n "Starting Oracle Listener: "
 su - $ORA_OWNR -c "env ORACLE_HOME=/oracle/XXX/12102 
/oracle/XXX/12102/bin/lsnrctl start LISTENER_XXX"


Don't abuse su for dropping privileges.

* http://jdebp.eu./FGA/dont-abuse-su-for-dropping-privileges.html


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&p=oracle12c&f=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/

___
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] 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 Andrei Borzenkov
On Tue, Nov 22, 2016 at 11:39 AM, Benoit SCHMID  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.
___
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 Andrei Borzenkov
On Tue, Nov 22, 2016 at 12:21 PM, Benoit SCHMID  wrote:
> 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?
>

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


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

2016-11-22 Thread Andrei Borzenkov
On Tue, Nov 22, 2016 at 10:38 AM, Cédric BRINER  wrote:
> Hi,
>
> We have been through a lot of tests, trying to make it reproductible
> with some easy scripts. You'll see at the bottom of this email, some
> links on the scripts used, what we have typed in our console, and the
> output of journalctl -b -1
>
>> systemd will only stop services at shutdown that are running. That
>> means you need to make sure your SysV script is properly hooked into
>> the start runlevels too, even if its start verb is just a nop.
> Mixing your comment, and the one from Reindl HARALD, we have a
> sysv-test.service which has /usr/bin/true for ExecStart, and a
> stop-sysv-test.bash for ExecStop which stops a daemon launched within
> the console.
>
> Before the init 6 we had:
> # systemctl status sysv-test
> ● sysv-test.service - sysv-test
>Loaded: loaded (/etc/systemd/system/sysv-test.service; enabled;
> vendor preset: disabled)
>Active: active (exited) since lun 2016-11-21 15:03:23 CET; 12min ago
>  Main PID: 2562 (code=exited, status=0/SUCCESS)
>CGroup: /system.slice/sysv-test.service
>
> nov 21 15:03:23 beryl5 systemd[1]: Started sysv-test.
> nov 21 15:03:23 beryl5 systemd[1]: Starting sysv-test...
>
>
> Now, when you look at the journalctl, you'll see that before the
> ExecStop starts:
> * write-sysv-test.pl is killed.
> * the fs /oracle/BAS/oraarch a "local-fs" is already unmounted.
>

Script that you start manually runs as part of login session and is
stopped concurrently with your service. So the first problem is, it
will be probably killed by logind when session terminates (user
exits), at least this is what current systemd version does by default.

It is possible to use systemd-run to start process in different scope
(outside of current session), then you still need to enable lingering
for this user.

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.

>
> The difficulty that we have, is how to have a daemon, no launched by
> systemd that can stop nicely by:
>  - having its filesystem during the stop of the daemon.
>  - able to use a stop script.
>

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.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel