Bugzilla – Attachment 452559 Details for
Bug 719214
ifup switch leaves NetworkManager running
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
Patch on top -- handle the localfs flag correctly too
NM.localfs.diff (text/plain), 3.67 KB, created by
Marius Tomaschewski
on 2011-09-22 16:14:38 UTC
(
hide
)
Description:
Patch on top -- handle the localfs flag correctly too
Filename:
MIME Type:
Creator:
Marius Tomaschewski
Created:
2011-09-22 16:14:38 UTC
Size:
3.67 KB
patch
obsolete
>diff --git a/scripts/network b/scripts/network >index 1ba5285..70a6cc3 100755 >--- a/scripts/network >+++ b/scripts/network >@@ -55,10 +55,27 @@ fi > > test "$DEBUG" = "EXTRA" && . scripts/extradebug > >+systemd_running () { >+ # We simply test whether systemd cgroup hierarchy is mounted >+ # where we return 0, non-zero if not. >+ /bin/mountpoint -q /sys/fs/cgroup/systemd >+} >+systemd_booting () { >+ # returns 0 when we boot, 1 in running system >+ systemctl show -p ActiveState default.target | grep -qi inactive >+} >+ > # Only use ifup option 'onboot' if booting or changing runlevel >-# Therefore we check if we were called from init >+# Therefore we check if we were called from init or while systemd boot. > FS_FILTER="" >-if [ -n "$INIT_VERSION" -a -z "$YAST_IS_RUNNING" ] ; then >+SD_RUNNING=no >+SD_BOOTING=no >+if systemd_running ; then >+ SD_RUNNING=yes >+ systemd_booting && SD_BOOTING=yes >+fi >+if [ \( -n "$INIT_VERSION" -o "$SD_BOOTING" = yes \) -a \ >+ -z "$YAST_IS_RUNNING" ] ; then > MODE=onboot > FS_FILTER=localfs > fi >@@ -102,43 +119,25 @@ test -f scripts/functions.common \ > || exit $R_INTERNAL > > >-systemd_running () { >-# We simply test whether systemd cgroup hierarchy is mounted >- if /bin/mountpoint -q /sys/fs/cgroup/systemd ; then >- return 1 >- fi >- return 0 >-} >- > > ###################################################################### >-# Start NetworkManager if wanted >+# Handle NetworkManager start when requested > # > # Some variables and functions are defined in > # /etc/sysconfig/network/scripts/functions > # because they are also used in ifup > # >-systemd_running ; sd=$? > if [ "$NETWORKMANAGER" = yes ] ; then >- if [ "$FS_FILTER" = "localfs" -o $sd = 1 ] ; then >- # NetworkManager is not supported without remotefs >- # and will be started later via network-remotefs. >- # NetworkManager should be started with its own .service >- # under systemd >+ if [ "$FS_FILTER" = "localfs" ] ; then >+ # Under systemd, NetworkManager is started via its >+ # own .service file, thus never while localfs is set. >+ # Otherwise, NetworkManager will be started later via >+ # network-remotefs init script (it is installed in >+ # /usr, thus depends on already started remotefs). > case $ACTION in > (status) exit 3 ;; >- (start) if [ $sd = 1 ]; then >- systemctl start NetworkManager.service >- fi >- exit 0 ;; >+ (start) exit 0 ;; > (stop) ;; >- (reload) if [ $sd = 1 -a netcontrol_running ]; then >- cd "$OLDPWD" >- ./$0 stop >- ./$0 start >- systemctl start NetworkManager.service >- fi >- exit 0 ;; > (*) exit 6 ;; > esac > elif [ ! -x "$NETWORKMANAGER_BIN" ] ; then >@@ -147,11 +146,38 @@ if [ "$NETWORKMANAGER" = yes ] ; then > "Please set" \ > "\n/etc/sysconfig/network/config:NetworkManager=no" \ > "or install NetworkManager." >+ elif [ "$SD_RUNNING" = "yes" ] ; then >+ # NetworkManager is started via own .service file under >+ # systemd, but we forward the restart/reload (sub)actions >+ # to catch configuration change from/to the NetworkManager. >+ case $ACTION in >+ (start) >+ if netcontrol_running ; then >+ cd "$OLDPWD" >+ $0 stop >+ fi >+ systemctl start NetworkManager.service >+ exit 0 >+ ;; >+ (stop) >+ systemctl stop NetworkManager.service >+ ;; >+ (reload) >+ if netcontrol_running ; then >+ cd "$OLDPWD" >+ $0 stop >+ $0 start >+ fi >+ systemctl start NetworkManager.service >+ exit 0 >+ ;; >+ (status) exit 3 ;; >+ (*) exit 6 ;; >+ esac > fi >-else >- if [ $sd = 1 -a nm_running ]; then >- systemctl stop NetworkManager.service >- fi >+elif [ "$SD_RUNNING" = "yes" -a nm_running ] ; then >+ # NetworkManager is disabled, stop it >+ systemctl stop NetworkManager.service > fi > > check_firewall() {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 719214
:
452281
|
452395
| 452559 |
452560