summaryrefslogtreecommitdiff
path: root/initscript/RedHat
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2005-05-16 01:28:45 +0000
committerDan Williams <dcbw@redhat.com>2005-05-16 01:28:45 +0000
commitc1069ccac576e820f57205d9da53bd38bbf11773 (patch)
tree4cedd98aae9b515c0a85be40e2a3526f959fe74a /initscript/RedHat
parenteaf1a33b0d6cffa30f27dccc2e5238c055af840a (diff)
downloadNetworkManager-c1069ccac576e820f57205d9da53bd38bbf11773.tar.gz
2005-05-15 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerDevice.[ch] src/NetworkManagerPolicy.c src/NetworkManager.c src/nm-dbus-nm.c - Remove the "just_added" parameter from nm_device_deactivate(). We no longer send the DeviceNoLongerActive signal unconditionally, but only when the device is actually active. * dispatcher-daemon/NetworkManagerDispatcher.c - (nmd_execute_scripts): convert to GLib directory functions from opendir(), and simplify the logic - (nmd_get_device_name): copy value from dbus reply so we don't segfault when we free it later on * initscript/RedHat/Makefile.am initscript/RedHat/NetworkManagerDispatcher - Add initscript for NetworkManagerDispatcher Patch from Bill Moss: * dispatcher-daemon/NetworkManagerDispatcher.c - Remove IP4AddressChange signal code including nmd_get_device_ip4_address() * src/NetworkManagerDbus.c - (nm_dbus_signal_device_ip4_address_change): remove. If the device goes up, and DeviceNowActive gets signaled, then the device has a new IP address anyway. There's no need for a separate signal. * src/NetworkManagerDevice.c - (nm_device_update_ip4_address): Don't send IP4AddressChange signal * src/NetworkManagerPolicy.c - (nm_policy_activation_finish): Send DeviceNowActive signal when the device activates successfully. This kind of went missing when I reworked the activation code. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@634 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Diffstat (limited to 'initscript/RedHat')
-rw-r--r--initscript/RedHat/Makefile.am4
-rwxr-xr-xinitscript/RedHat/NetworkManagerDispatcher74
2 files changed, 76 insertions, 2 deletions
diff --git a/initscript/RedHat/Makefile.am b/initscript/RedHat/Makefile.am
index 3ce9ed4a51..8796239a30 100644
--- a/initscript/RedHat/Makefile.am
+++ b/initscript/RedHat/Makefile.am
@@ -1,5 +1,5 @@
-EXTRA_DIST = NetworkManager
+EXTRA_DIST = NetworkManager NetworkManagerDispatcher
initddir = $(sysconfdir)/rc.d/init.d
-initd_SCRIPTS = NetworkManager
+initd_SCRIPTS = NetworkManager NetworkManagerDispatcher
diff --git a/initscript/RedHat/NetworkManagerDispatcher b/initscript/RedHat/NetworkManagerDispatcher
new file mode 100755
index 0000000000..a01f0ba90a
--- /dev/null
+++ b/initscript/RedHat/NetworkManagerDispatcher
@@ -0,0 +1,74 @@
+#!/bin/sh
+#
+# NetworkManager: NetworkManagerDispatcher daemon
+#
+# chkconfig: - 98 02
+# description: This daemon automatically runs scripts when NetworkManager \
+# changes the network state.
+#
+# processname: NetworkManagerDispatcher
+# pidfile: /var/run/NetworkManagerDispatcher.pid
+#
+
+# Sanity checks.
+[ -x /usr/bin/NetworkManagerDispatcher ] || exit 1
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+# so we can rearrange this easily
+processname=NetworkManagerDispatcher
+servicename=NetworkManagerDispatcher
+pidfile=/var/run/NetworkManagerDispatcher.pid
+
+RETVAL=0
+
+start()
+{
+ echo -n $"Starting NetworkManagerDispatcher daemon: "
+ daemon --check $servicename $processname
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicename && echo `/sbin/pidof $processname` > $pidfile
+}
+
+stop()
+{
+ echo -n $"Stopping NetworkManagerDispatcher daemon: "
+
+ killproc $servicename -TERM
+ RETVAL=$?
+ echo
+ if [ $RETVAL -eq 0 ]; then
+ rm -f /var/lock/subsys/$servicename
+ rm -f $pidfile
+ fi
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ status)
+ status $processname
+ RETVAL=$?
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ condrestart)
+ if [ -f /var/lock/subsys/$servicename ]; then
+ stop
+ start
+ fi
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart|condrestart}"
+ ;;
+esac
+exit $RETVAL