reopen 760796
stop

Hey.

1.2-1 seems to have fixed the systemd issues, so coming back to this bug
now:
I've just made updates an apparently something was amongst which made
needrestart believe that libvirtd needs a restart (no idea whether this
first assumption is actually justified already) anyway...
I choose to restart it (which actually happened) but still right
afterwards, needrestart again proposes to restart it, for example:

1) Frist run
# needrestart -vn
[Core] Using UI 'NeedRestart::UI::stdio'...
[main] detected systemd
[main] #4655 uses obsolete binary /usr/bin/ssh-agent.dpkg-new
[main] #4655 is a child of #4618
[Core] #4749 is a NeedRestart::Interp::Python
[Core] #4966 is a NeedRestart::Interp::Python
[Core] #31189 is a NeedRestart::Interp::Python
[main] #31720 uses obsolete binary /usr/sbin/dnsmasq.dpkg-new
[main] #31720 is not a child
[main] #31721 uses obsolete binary /usr/sbin/dnsmasq.dpkg-new
[main] #31721 is a child of #31720
[main] #31779 uses obsolete binary /usr/sbin/dnsmasq.dpkg-new
[main] #31779 is not a child
[main] #31780 uses obsolete binary /usr/sbin/dnsmasq.dpkg-new
[main] #31780 is a child of #31779
[main] #31919 uses obsolete binary /usr/bin/ssh.dpkg-new
[main] #31919 is a child of #31889
[main] #31949 uses obsolete binary /usr/bin/ssh.dpkg-new
[main] #31949 is a child of #31854
[main] #4618 exe => /usr/bin/cinnamon-session
[main] #4618 unexpected cgroup
'/user.slice/user-1000.slice/session-3.scope'
[main] #4618 running /etc/needrestart/hook.d/10-dpkg
[main] #4618 package: cinnamon-session
[main] #4618 running /etc/needrestart/hook.d/20-rpm
[main] #4618 running /etc/needrestart/hook.d/90-none
[main] #31720 exe => /usr/sbin/dnsmasq.dpkg-new
[main] #31720 is libvirtd.service
[main] #31779 exe => /usr/sbin/dnsmasq.dpkg-new
[main] #31779 is libvirtd.service
[main] #31854 exe => /bin/bash
[main] #31854 unexpected cgroup
'/user.slice/user-1000.slice/session-3.scope'
[main] #31854 running /etc/needrestart/hook.d/10-dpkg
[main] #31854 package: bash
[main] #31854 running /etc/needrestart/hook.d/20-rpm
[main] #31854 running /etc/needrestart/hook.d/90-none
[main] #31889 exe => /bin/bash
[main] #31889 unexpected cgroup
'/user.slice/user-1000.slice/session-3.scope'
[main] #31889 running /etc/needrestart/hook.d/10-dpkg
[main] #31889 package: bash
[main] #31889 running /etc/needrestart/hook.d/20-rpm
[main] #31889 running /etc/needrestart/hook.d/90-none
[Kernel] Linux: kernel release 3.16-2-amd64, kernel version #1 SMP
Debian 3.16.3-2 (2014-09-20)
Failed to load NeedRestart::Kernel::kFreeBSD: [Kernel/kFreeBSD] Not
running on GNU/kFreeBSD!
[Kernel/Linux] /boot/vmlinuz-3.16-2-amd64 => 3.16-2-amd64
(debian-ker...@lists.debian.org) #1 SMP Debian 3.16.3-2 (2014-09-20)
[3.16-2-amd64]*
[Kernel/Linux] Expected kernel version: 3.16-2-amd64
Running kernel seems to be up-to-date.
Services to be restarted:
Restart libvirtd.service? [yNas] N



2) Manually restarting it:
# /etc/init.d/libvirtd restart
[ ok ] Restarting libvirtd (via systemctl): libvirtd.service.
# systemctl restart libvirtd.service 

(It actually *is* restarted, since virt-manager looses the connection)



3) Running needrestart again:
# needrestart -vn
[Core] Using UI 'NeedRestart::UI::stdio'...
[main] detected systemd
[main] #4655 uses obsolete binary /usr/bin/ssh-agent.dpkg-new
[main] #4655 is a child of #4618
[Core] #4749 is a NeedRestart::Interp::Python
[Core] #4966 is a NeedRestart::Interp::Python
[Core] #31189 is a NeedRestart::Interp::Python
[main] #31720 uses obsolete binary /usr/sbin/dnsmasq.dpkg-new
[main] #31720 is not a child
[main] #31721 uses obsolete binary /usr/sbin/dnsmasq.dpkg-new
[main] #31721 is a child of #31720
[main] #31779 uses obsolete binary /usr/sbin/dnsmasq.dpkg-new
[main] #31779 is not a child
[main] #31780 uses obsolete binary /usr/sbin/dnsmasq.dpkg-new
[main] #31780 is a child of #31779
[main] #31919 uses obsolete binary /usr/bin/ssh.dpkg-new
[main] #31919 is a child of #31889
[main] #31949 uses obsolete binary /usr/bin/ssh.dpkg-new
[main] #31949 is a child of #31854
[main] #4618 exe => /usr/bin/cinnamon-session
[main] #4618 unexpected cgroup
'/user.slice/user-1000.slice/session-3.scope'
[main] #4618 running /etc/needrestart/hook.d/10-dpkg
[main] #4618 package: cinnamon-session
[main] #4618 running /etc/needrestart/hook.d/20-rpm
[main] #4618 running /etc/needrestart/hook.d/90-none
[main] #31720 exe => /usr/sbin/dnsmasq.dpkg-new
[main] #31720 is libvirtd.service
[main] #31779 exe => /usr/sbin/dnsmasq.dpkg-new
[main] #31779 is libvirtd.service
[main] #31854 exe => /bin/bash
[main] #31854 unexpected cgroup
'/user.slice/user-1000.slice/session-3.scope'
[main] #31854 running /etc/needrestart/hook.d/10-dpkg
[main] #31854 package: bash
[main] #31854 running /etc/needrestart/hook.d/20-rpm
[main] #31854 running /etc/needrestart/hook.d/90-none
[main] #31889 exe => /bin/bash
[main] #31889 unexpected cgroup
'/user.slice/user-1000.slice/session-3.scope'
[main] #31889 running /etc/needrestart/hook.d/10-dpkg
[main] #31889 package: bash
[main] #31889 running /etc/needrestart/hook.d/20-rpm
[main] #31889 running /etc/needrestart/hook.d/90-none
[Kernel] Linux: kernel release 3.16-2-amd64, kernel version #1 SMP
Debian 3.16.3-2 (2014-09-20)
Failed to load NeedRestart::Kernel::kFreeBSD: [Kernel/kFreeBSD] Not
running on GNU/kFreeBSD!
[Kernel/Linux] /boot/vmlinuz-3.16-2-amd64 => 3.16-2-amd64
(debian-ker...@lists.debian.org) #1 SMP Debian 3.16.3-2 (2014-09-20)
[3.16-2-amd64]*
[Kernel/Linux] Expected kernel version: 3.16-2-amd64
Running kernel seems to be up-to-date.
Services to be restarted:
Restart libvirtd.scervice? [yNas] 


No I've tried some things and found out that these processes caused
needrestart to believe that libvirtd needs to be restarted: 
# ps ax | grep libvirt
10677 ?        Ssl    0:00 /usr/sbin/libvirtd
11264 pts/0    S+     0:00 grep --color=auto libvirt
31720 ?        S      0:00 /usr/sbin/dnsmasq 
--conf-file=/var/lib/libvirt/dnsmasq/main.conf 
--dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
31721 ?        S      0:00 /usr/sbin/dnsmasq 
--conf-file=/var/lib/libvirt/dnsmasq/main.conf 
--dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
31779 ?        S      0:00 /usr/sbin/dnsmasq 
--conf-file=/var/lib/libvirt/dnsmasq/insecure.conf 
--dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
31780 ?        S      0:00 /usr/sbin/dnsmasq 
--conf-file=/var/lib/libvirt/dnsmasq/insecure.conf 
--dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
i.e. after killing them (without restarting libvirtd another time) made
the needrestart suggestion to restart libvirtd go away.


dnsmasq is started by libvirtd (which is triggered via virt-manager in
my case, when I bring up these virtual networks), an apparently they all
run in the same cgroup (no big supirse with systemd): 
│ ├─libvirtd.service
│ │ ├─10677 /usr/sbin/libvirtd
│ │ ├─31720 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/main.conf 
--dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
│ │ ├─31721 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/main.conf 
--dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
│ │ ├─31779 /usr/sbin/dnsmasq 
--conf-file=/var/lib/libvirt/dnsmasq/insecure.conf 
--dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
│ │ └─31780 /usr/sbin/dnsmasq 
--conf-file=/var/lib/libvirt/dnsmasq/insecure.conf 
--dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper


So I guess the problem is actually that the libvirtd init-script / unit
files don't handle the restart "correctly"[0] and let their spawned
processes alive.

Now I don't know need restart detects which init-script / unit file it
needs to restart when a given process uses outdated libs.
With systemd only it would be clear, cause every service runs in it's
cgroup, but with sysvinit?
Anyway if you agree this is the cause for this (not-so-)false positive,
then we can retitle and reassign this to libvirtd.


Of cause one issue remains, actually two, but with respect to
needrestart they both lead to the same question and I'll open a separate
bug for it.
Is it really the task/duty of libvirtd's initscript/unit file to restart
dnsmasq, which it could also just consider to be another "external"
service.
So libvirtd maintainers/upstream could argue,... "we just start dnsmasq
for some arbitrary virtual networks which, even though set up by our
tools and used with our VMs, are still generic networks, which we just
start once but not maintain thereafter".
So from a needrestart POV the question is: shouldn't it tell the user
somehow (in non-verbose mode) which processes (in terms of PID) it think
should be restarted?


Cheers,
Chris.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to