[libvirt] [PATCH] libvirtd.service: add NotifyService=all

systemd.service(5) says that this should be set when using Type=notify, and indeed we seem to have a bug report resulting from this not being set: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1574566 Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com> --- daemon/libvirtd.service.in | 1 + 1 file changed, 1 insertion(+) diff --git a/daemon/libvirtd.service.in b/daemon/libvirtd.service.in index 1616e7a..a13f9af 100644 --- a/daemon/libvirtd.service.in +++ b/daemon/libvirtd.service.in @@ -24,6 +24,7 @@ KillMode=process Restart=on-failure # Override the maximum number of opened files #LimitNOFILE=2048 +NotifyAccess=all [Install] WantedBy=multi-user.target -- 2.7.4

On Mon, Apr 25, 2016 at 03:52:25PM +0000, Serge Hallyn wrote:
systemd.service(5) says that this should be set when using Type=notify, and indeed we seem to have a bug report resulting from this not being set:
Not quite - the man page says it will default to NotifyAccess=main when not set, which on the surface ought to be fine for us. Setting it to NotifyAccess=all, allows non-main tasks to notify systemd ie things spawned by libvirtd. This doesn't seem like something we should need or want.
https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1574566
I see that says: Apr 25 12:38:11 hostname systemd[1]: libvirt-bin.service: Got notification message from PID 1038, but reception only permitted for main PID 1003 I thought at first this might be a case of not distinguishing between threads and processes, but libvirtd calls sd_notify() from its main thread IIUC. Did the user have some kind of wrapper script around libvirtd, so libvirtd isn't the first thing being launched. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

Quoting Daniel P. Berrange (berrange@redhat.com):
On Mon, Apr 25, 2016 at 03:52:25PM +0000, Serge Hallyn wrote:
systemd.service(5) says that this should be set when using Type=notify, and indeed we seem to have a bug report resulting from this not being set:
Not quite - the man page says it will default to NotifyAccess=main when not set, which on the surface ought to be fine for us. Setting it to NotifyAccess=all, allows non-main tasks to notify systemd ie things spawned by libvirtd. This doesn't seem like something we should need or want.
Oh, hm. I figured any thread could do it. If not then I guess this patch may be wrong.
https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1574566
I see that says:
Apr 25 12:38:11 hostname systemd[1]: libvirt-bin.service: Got notification message from PID 1038, but reception only permitted for main PID 1003
I thought at first this might be a case of not distinguishing between threads and processes, but libvirtd calls sd_notify() from its main thread IIUC.
Did the user have some kind of wrapper script around libvirtd, so libvirtd isn't the first thing being launched.
Hm, not that I know of; but perhaps there is simply a libvirtd that was started by hand or sysvinit or something. I'll try get some more info. thanks -serge
participants (2)
-
Daniel P. Berrange
-
Serge Hallyn