Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 493632 - net-misc/networkmanager-0.9.8.8: '/etc/init.d/NetworkManager restart' doesn't kill all child processes
Summary: net-misc/networkmanager-0.9.8.8: '/etc/init.d/NetworkManager restart' doesn't...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL: https://bugzilla.gnome.org/show_bug.c...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-08 09:01 UTC by Nikoli
Modified: 2015-02-18 12:29 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch for /etc/init.d/NetworkManager (init.d.NetworkManager.patch,859 bytes, patch)
2014-11-08 18:13 UTC, Nikoli
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikoli 2013-12-08 09:01:00 UTC
In net-misc/networkmanager-0.9.6.4 '/etc/init.d/NetworkManager restart' worked fine for ethernet devices, but for networkmanager-0.9.8.8 it is broken:
it disables ethernet interfaces, but does not re-enable them.

restart action does not kill running (started by NM) dhcpcd (checked /run/dhcpcd-*.pid and ps), for enabling ethernet i need to kill dhcpcd and restart NM again, then it will work fine until next restart.


Portage 2.2.7 (hardened/linux/amd64, gcc-4.7.3, glibc-2.16.0, 3.11.9-hardened x86_64)
=================================================================
                        System Settings
=================================================================
KiB Mem:    65825872 total,  49216668 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Sun, 08 Dec 2013 06:45:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
app-shells/bash:          4.2_p45
dev-lang/python:          2.7.5-r3
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.69
sys-devel/automake:       1.13.4
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.7.3-r1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.16.0
Repositories: gentoo nikoli
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=corei7-avx -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0 /usr/share/themes/oxygen-gtk/gtk-3.0"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=corei7-avx -O2 -pipe"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs cgroup collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch preserve-libs protect-owned sandbox sfperms strict test unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j9"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTDIR_OVERLAY="/var/lib/layman/nikoli"
USE="X a52 aac acl acpi aes-ni alsa amd64 amr audiofile avx bash-completion bzip2 cairo caps cdda cddb cdio cdparanoia cdr celt cli consolekit cracklib crypt css cups cxx dbus djvu dri dts dv dvd dvdr encode exif fat ffmpeg flac fluidsynth fontconfig fortran gd geoip gif gimp gmp gnutls gphoto2 gpm graphviz gsm gstreamer gtk handbook hardened iconv icu id3tag idn ilbc imagemagick imap imlib ios ipod ipv6 jbig jpeg jpeg2k justify kde kipi lame laptop lcms libass libnotify libproxy libsamplerate lm_sensors lzma lzo mac mad matroska mikmod mmx mmxext modplug modules mp3 mp4 mpeg mtp mudflap multilib musepack musicbrainz ncurses networkmanager nls nptl nptlonly ntfs ogg openal openexr opengl openmp opus pam pango pax_kernel pcre pdf phonon plasma pm-utils png policykit postscript qt3support qt4 quicktime rar raw readline reiserfs replaygain rtmp sasl scanner semantic-desktop session sid smp sndfile socks5 speex spell sqlite sse sse2 sse3 sse4_1 ssl ssse3 startup-notification svg symlink sysfs taglib theora threads thumbnail tiff truetype tta udev udisks unicode upnp upower usb v4l v4l2 vcd vdpau vorbis vpx wavpack webkit webp wifi wma wmf x264 xattr xcb xcomposite xface xinerama xml xmp xpm xscreensaver xv xvid xz zip zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="*" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-minimizer" LINGUAS="ru ru_RU en" NGINX_MODULES_HTTP="access auth_basic autoindex fastcgi gzip rewrite" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby20" USERLAND="GNU" VIDEO_CARDS="radeon r600 modesetting vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

net-misc/networkmanager-0.9.8.8 was built with the following:
USE="consolekit dhcpcd introspection nss ppp test wifi -avahi -bluetooth -connection-sharing -dhclient -gnutls -modemmanager -resolvconf -systemd -vala -wext"


net-misc/dhcpcd-5.6.4 was built with the following:
USE="(multilib) test zeroconf" ABI_X86="64"
Comment 1 Nikoli 2013-12-08 09:11:43 UTC
As a workaround i added to /etc/conf.d/NetworkManager line:
rc_cgroup_cleanup="YES"
Comment 2 Pacho Ramos gentoo-dev 2013-12-09 08:46:38 UTC
(In reply to Nikoli from comment #1)
> As a workaround i added to /etc/conf.d/NetworkManager line:
> rc_cgroup_cleanup="YES"

It isn't probably a workaround but the proper way to fix it (like we need to go for gdm init.d script since 3.8). CCing openrc people to know if there is any "more elegant" way to solve this
Comment 3 Nikoli 2013-12-16 15:14:41 UTC
I think it is NM or dhcpcd bug, because pid for dhcpcd is created in wrong place:
$ strings /usr/sbin/NetworkManager|grep 'dhcpcd.*pid'
/var/lib/NetworkManager/dhcpcd-%s.pid
dhcpcd started with pid %d
# find /var/ /run/ -name 'dhcpcd*.pid'
/run/dhcpcd-eno1.pid
# lsof -n|grep 'dhcpcd.*.pid'
dhcpcd    22018             root    4wW     REG               0,13        6   28959849 /run/dhcpcd-eth0.pid
Comment 4 William Hubbs gentoo-dev 2013-12-17 16:50:39 UTC
(In reply to Nikoli from comment #3)
> I think it is NM or dhcpcd bug, because pid for dhcpcd is created in wrong
> place:
> $ strings /usr/sbin/NetworkManager|grep 'dhcpcd.*pid'
> /var/lib/NetworkManager/dhcpcd-%s.pid


Why is NM putting pid files in /var/lib/NetworkManager instead of /var/run or more preferably /run?

I think this might be the issue.
Comment 5 Pacho Ramos gentoo-dev 2013-12-17 19:59:14 UTC
(In reply to William Hubbs from comment #4)
> (In reply to Nikoli from comment #3)
> > I think it is NM or dhcpcd bug, because pid for dhcpcd is created in wrong
> > place:
> > $ strings /usr/sbin/NetworkManager|grep 'dhcpcd.*pid'
> > /var/lib/NetworkManager/dhcpcd-%s.pid
> 
> 
> Why is NM putting pid files in /var/lib/NetworkManager instead of /var/run
> or more preferably /run?
> 
> I think this might be the issue.

Would openrc being able to take care of that pid file that is being created by networkmanager and not init.d script? (for reporting to upstream ;))
Comment 6 William Hubbs gentoo-dev 2013-12-18 02:11:08 UTC
(In reply to Pacho Ramos from comment #5)
> (In reply to William Hubbs from comment #4)
> > (In reply to Nikoli from comment #3)
> > > I think it is NM or dhcpcd bug, because pid for dhcpcd is created in wrong
> > > place:
> > > $ strings /usr/sbin/NetworkManager|grep 'dhcpcd.*pid'
> > > /var/lib/NetworkManager/dhcpcd-%s.pid
> > 
> > 
> > Why is NM putting pid files in /var/lib/NetworkManager instead of /var/run
> > or more preferably /run?
> > 
> > I think this might be the issue.
> 
> Would openrc being able to take care of that pid file that is being created
> by networkmanager and not init.d script? (for reporting to upstream ;))

Wait, I just read this over again. I'm wrong about the locations of the dhcpcd  pid files making a difference; it doesn't. I looked at the OpenRC script, and I do not see any obvious issues. When NM goes down, it should stop its child processes, so the question is, why doesn't it kill dhcpcd on the way down?
Comment 7 Pacho Ramos gentoo-dev 2013-12-18 08:09:54 UTC
(In reply to William Hubbs from comment #6) 
> Wait, I just read this over again. I'm wrong about the locations of the
> dhcpcd  pid files making a difference; it doesn't. I looked at the OpenRC
> script, and I do not see any obvious issues. When NM goes down, it should
> stop its child processes, so the question is, why doesn't it kill dhcpcd on
> the way down?

I guess a simple "killall networkmanager" doesn't kill dhcpcd, right? In that case, this looks like gdm case and, then, I would report to upstream that "killall" doesn't do that with networkmanager and wait a bit to see if that is expected (like was the case with gdm) or they consider it a bug and fix it ;)
Comment 8 William Hubbs gentoo-dev 2013-12-18 17:28:35 UTC
Right, it looks like this is the path you want to follow, find out why
NM isn't killing child processes.
Comment 9 Pacho Ramos gentoo-dev 2013-12-23 22:13:51 UTC
Nikoli, can you please reply in upstream report to:
https://bugzilla.gnome.org/show_bug.cgi?id=720774#c1
?

Thanks!
Comment 10 Pacho Ramos gentoo-dev 2014-09-22 18:32:22 UTC
(In reply to Pacho Ramos from comment #9)
> Nikoli, can you please reply in upstream report to:
> https://bugzilla.gnome.org/show_bug.cgi?id=720774#c1
> ?
> 
> Thanks!

Nikoli, please provide to upstream the logs that are being shown when it tries to be killed

Thanks
Comment 11 Nikoli 2014-11-08 18:13:57 UTC
Created attachment 388888 [details, diff]
patch for /etc/init.d/NetworkManager
Comment 12 Nikoli 2014-11-08 18:18:18 UTC
Seems upstream logic is "killing NM != disabling networking", so when NM is stopped all interfaces are up and running. I think this is not always optimal behaviour, 'rc-service NetworkManager stop' should also disable all interfaces it created and kill all processes it started. 'nmcli networking off' command does exactly this, so attached patch fixed problem for me.
Comment 13 Pacho Ramos gentoo-dev 2014-11-10 10:54:42 UTC
Not sure if you could at least reply to https://bugzilla.gnome.org/show_bug.cgi?id=720774#c1 as, per I see in bug report, upstream asked that and never got replied ... :/
Comment 14 Pacho Ramos gentoo-dev 2015-02-18 12:29:04 UTC
(In reply to Pacho Ramos from comment #13)
> Not sure if you could at least reply to
> https://bugzilla.gnome.org/show_bug.cgi?id=720774#c1 as, per I see in bug
> report, upstream asked that and never got replied ... :/