Re,
I was able to reproduce the problem. needrestart uses the service name
of $PID retrieved from /proc/$PID/cgroup when the host runs under systemd:
thomas@deje:~$ cat /proc/16880/cgroup
8:perf_event:/lxc/cont1
7:blkio:/
6:net_cls,net_prio:/lxc/cont1
5:freezer:/lxc/cont1
4:devices:/
3:cpu,cpuacct:/
2:cpuset:/lxc/cont1
1:name=systemd:/system.slice/ssh.service/system.slice/nginx.service
^^^^^^^^^^^^^
This happens on systemd but Sys-V init is not affected (since
needrestart won't use the cgroup stuff). Under Sys-V needrestart would
suggest to restart lxc (which might not be reasonable, too).
IMHO needrestart requires (LXC) container awareness and allow to restart
the entire containers or ignore (some of) them by a configuration option.
HTH,
Thomas
On 04/23/2015 06:57 PM, Brian Minton wrote:
> On Thu, Apr 23, 2015 at 04:54:08PM +0200, Thomas Liske wrote:
>> Hi Brian,
>
>> this sounds wired - needrestart should suggest to restart lxc. Could you
>> please provide the output of:
>
>> # needrestart -v -r l
>
> # needrestart -v -r l
> [Core] Using UI 'NeedRestart::UI::stdio'...
> [main] detected systemd
> [Core] #3081 is a NeedRestart::Interp::Python
> [Python] #3081: could not get a source file, skipping
> [Core] #3921 is a NeedRestart::Interp::Python
> [Core] #4716 is a NeedRestart::Interp::Python
> [Core] #4751 is a NeedRestart::Interp::Perl
> [Core] #4853 is a NeedRestart::Interp::Perl
> [Core] #4917 is a NeedRestart::Interp::Perl
> [Core] #5179 is a NeedRestart::Interp::Perl
> [Perl] #5179: could not get a source file, skipping
> [Core] #5410 is a NeedRestart::Interp::Perl
> [Core] #6126 is a NeedRestart::Interp::Perl
> [main] #16067 uses obsolete /lib/x86_64-linux-gnu/libattr.so.1.1.0
> [main] #16067 is a child of #15996
> [main] #16307 uses obsolete /lib/x86_64-linux-gnu/libattr.so.1.1.0
> [main] #16307 is a child of #16067
> [main] #16389 uses obsolete /lib/x86_64-linux-gnu/libattr.so.1.1.0
> [main] #16389 is a child of #16067
> [main] #16390 uses obsolete /usr/bin/dbus-daemon
> [main] #16390 is a child of #16067
> [main] #16397 uses obsolete /sbin/agetty
> [main] #16397 is a child of #16067
> [main] #17047 uses non-existing /usr/sbin/nginx
> [main] #17047 is a child of #16067
> [main] #17048 uses non-existing /usr/sbin/nginx
> [main] #17048 is a child of #17047
> [main] #17049 uses non-existing /usr/sbin/nginx
> [main] #17049 is a child of #17047
> [main] #17050 uses non-existing /usr/sbin/nginx
> [main] #17050 is a child of #17047
> [main] #17051 uses non-existing /usr/sbin/nginx
> [main] #17051 is a child of #17047
> [main] #17074 uses obsolete /usr/local/bin/hockeypuck
> [main] #17074 is a child of #16067
> [main] #15996 exe => /usr/bin/lxc-autostart
> [main] #15996 is lxc.service
> [main] #16067 exe => /lib/systemd/systemd
> [main] #16067 is lxc.service
> [main] #17047 exe => /usr/sbin/nginx
> [main] #17047 is nginx.service
> [Kernel] Linux: kernel release 4.0.0, kernel version #1 SMP Mon Apr 13
> 11:08:28 EDT 2015
> [Kernel/Linux] /boot/vmlinuz.old => 3.4.3 ([email protected])
> #5 SMP Fri Jun 22 20:16:56 UTC 2012 [3.4.3]
> [Kernel/Linux] /boot/vmlinuz-4.0.0 => 4.0.0
> ([email protected]) #1 SMP Mon Apr 13 11:08:28 EDT 2015
> [4.0.0]*
> [Kernel/Linux] /boot/vmlinuz-3.7.0 => 3.7.0
> ([email protected]) #1 SMP Tue Dec 11 20:53:08 UTC 2012
> [3.7.0]
> [Kernel/Linux] /boot/vmlinuz-3.4.3 => 3.4.3
> ([email protected]) #5 SMP Fri Jun 22 20:16:56 UTC 2012
> [3.4.3]
> [Kernel/Linux] /boot/vmlinuz-3.1.6.old => 3.1.6
> ([email protected]) #1 SMP Sat Jan 7 12:05:54 EST 2012
> [3.1.6]
> [Kernel/Linux] /boot/vmlinuz-2.6.35.5.old => 2.6.35.5
> ([email protected]) #2 SMP Wed Sep 22 02:11:40 EDT 2010
> [2.6.35.5]
> [Kernel/Linux] /boot/vmlinuz-2.6.31 => 2.6.31
> ([email protected]) #1 SMP Fri Sep 11 17:20:59 EDT 2009
> [2.6.31]
> [Kernel/Linux] /boot/vmlinuz => 3.7.0 ([email protected]) #1
> SMP Tue Dec 11 20:53:08 UTC 2012 [3.7.0]
> [Kernel/Linux] Expected kernel version: 4.0.0
> Running kernel seems to be up-to-date.
> Services to be restarted:
> systemctl restart lxc.service nginx.service
>
>
>
>> Is there something special in the lxc container config?
>
>
> # cat /var/lib/lxc/hockeypuck/config
> # Template used to create this container:
> /usr/share/lxc/templates/lxc-download
> # Parameters passed to the template:
> # For additional config options, please look at lxc.container.conf(5)
>
> # Distribution configuration
> lxc.include = /usr/share/lxc/config/debian.common.conf
> lxc.arch = x86_64
>
> # Container specific configuration
> lxc.rootfs = /var/lib/lxc/hockeypuck/rootfs
> lxc.utsname = hockeypuck
> lxc.start.auto = 1
>
> # Network configuration
> lxc.network.type = veth
> lxc.network.flags = up
> lxc.network.link = br0
> lxc.network.hwaddr = 00:FF:AA:00:00:01
>
> # mount the keyserver dump directory
> lxc.mount.entry = /mnt/scratch/keyserver-dump
> /var/lib/lxc/hockeypuck/rootfs/home/hockeypuck/dump auto bind,ro,auto
> 0 0
>
>
> On Thu, Apr 23, 2015 at 10:54 AM, Thomas Liske <[email protected]> wrote:
>> Hi Brian,
>>
>> On 04/23/2015 03:54 PM, Brian Minton wrote:
>>> Package: needrestart
>>> Version: 1.2-8
>>> Severity: normal
>>>
>>> Dear Maintainer,
>>>
>>> Frequently, when needresrart runs, it wants to restart nginx.service .
>>> However, I don't have nginx even installed on this system. I do have
>>> nginx running in an lxc container, which is probably the instance it's
>>> seeing.
>>
>> this sounds wired - needrestart should suggest to restart lxc. Could you
>> please provide the output of:
>>
>> # needrestart -v -r l
>>
>> Is there something special in the lxc container config?
>>
>>
>> TIA,
>> Thomas
>>
>>> -- Package-specific info:
>>> needrestart output:
>>> Running kernel seems to be up-to-date.
>>> No services need to be restarted.
>>>
>>> checkrestart output:
>>>
>>>
>>> -- System Information:
>>> Debian Release: 8.0
>>> APT prefers unstable
>>> APT policy: (500, 'unstable'), (500, 'stable'), (1, 'experimental')
>>> Architecture: amd64 (x86_64)
>>>
>>> Kernel: Linux 4.0.0 (SMP w/4 CPU cores)
>>> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
>>> Shell: /bin/sh linked to /bin/dash
>>> Init: systemd (via /run/systemd/system)
>>>
>>> Versions of packages needrestart depends on:
>>> ii dpkg 1.17.25
>>> ii libmodule-find-perl 0.12-1
>>> ii libmodule-scandeps-perl 1.16-1
>>> ii libproc-processtable-perl 0.51-1
>>> ii libsort-naturally-perl 1.03-1
>>> ii libterm-readkey-perl 2.32-1+b1
>>> ii perl 5.20.2-3
>>>
>>> needrestart recommends no packages.
>>>
>>> needrestart suggests no packages.
>>>
>>> -- no debconf information
>>>
>>>
>>
>> --
>>
>> :: WWW: http://fiasko-nw.net/~thomas/ ::
>> ::: Jabber: xmpp:[email protected] :::
>> :: flickr: http://www.flickr.com/photos/laugufe/ ::
--
:: WWW: http://fiasko-nw.net/~thomas/ ::
::: Jabber: xmpp:[email protected] :::
:: flickr: http://www.flickr.com/photos/laugufe/ ::
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]