These initscripts weren't modified for a long time. Are they just unused or flawless? It seems they are no longer best-practice (e.g. NetworkManager supports reloading configuration with SIGHUP, which only x implement). Nowadays some distributions moved to systemd and quite possible nobody uses these scripts. Also, any potential downstream user already has a (probably modified) copy of these initscripts. Just remove them. --- .gitignore | 5 +- configure.ac | 7 -- initscript/Arch/networkmanager.in | 67 -------------------- initscript/Debian/NetworkManager.in | 91 ------------------------ initscript/Mandriva/networkmanager.in | 107 ------------------------------ initscript/RedHat/NetworkManager.in | 104 ----------------------------- initscript/SUSE/networkmanager.in | 51 -------------- initscript/Slackware/rc.networkmanager.in | 92 ------------------------- initscript/linexa/networkmanager.in | 59 ---------------- 9 files changed, 2 insertions(+), 581 deletions(-) delete mode 100644 initscript/Arch/networkmanager.in delete mode 100755 initscript/Debian/NetworkManager.in delete mode 100644 initscript/Mandriva/networkmanager.in delete mode 100755 initscript/RedHat/NetworkManager.in delete mode 100644 initscript/SUSE/networkmanager.in delete mode 100644 initscript/Slackware/rc.networkmanager.in delete mode 100644 initscript/linexa/networkmanager.in diff --git a/.gitignore b/.gitignore index d6a956c..6629338 100644 --- a/.gitignore +++ b/.gitignore @@ -139,9 +139,6 @@ test-*.trs /include/nm-version-macros.h -/initscript/Slackware/rc.networkmanager -/initscript/*/[Nn]etwork[Mm]anager - /introspection/all.xml /introspection/nmdbus-*.c /introspection/nmdbus-*.h @@ -276,5 +273,7 @@ test-*.trs # but they were on older versions. Thus keep ignoring them # otherwise when switching branches these untracked files show # up. +/initscript/Slackware/rc.networkmanager +/initscript/*/[Nn]etwork[Mm]anager /src/settings/plugins/ifnet/tests/check_ifnet diff --git a/configure.ac b/configure.ac index c028f32..112f4e5 100644 --- a/configure.ac +++ b/configure.ac @@ -1061,13 +1061,6 @@ clients/Makefile clients/cli/Makefile clients/tui/Makefile clients/tui/newt/Makefile -initscript/RedHat/NetworkManager -initscript/Debian/NetworkManager -initscript/Slackware/rc.networkmanager -initscript/SUSE/networkmanager -initscript/Arch/networkmanager -initscript/Mandriva/networkmanager -initscript/linexa/networkmanager introspection/Makefile introspection/all.xml man/Makefile diff --git a/initscript/Arch/networkmanager.in b/initscript/Arch/networkmanager.in deleted file mode 100644 index 4846427..0000000 --- a/initscript/Arch/networkmanager.in +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash - -prefix= prefix@ -exec_prefix= prefix@ -sbindir= sbindir@ - -NETWORKMANAGER_BIN=${sbindir}/NetworkManager - -# general config -. /etc/rc.conf -. /etc/rc.d/functions - -# Sanity checks. -[ -x $NETWORKMANAGER_BIN ] || exit 0 - -PID=`pidof -o %PPID $NETWORKMANAGER_BIN` -case "$1" in - start) - stat_busy "Starting NetworkManager" - [ ! -d /var/run/NetworkManager ] && install -d /var/run/NetworkManager - if [ -z "$PID" ]; then - $NETWORKMANAGER_BIN - fi - if [ ! -z "$PID" -o $? -gt 0 ]; then - stat_fail - else - add_daemon networkmanager - stat_done - fi - ;; - stop) - stat_busy "Stopping NetworkManager" - [ ! -z "$PID" ] && kill $PID &> /dev/null - if [ $? -gt 0 ]; then - stat_fail - else - rm_daemon networkmanager - stat_done - fi - ;; - restart) - $0 stop - sleep 1 - $0 start - ;; - sleep) - /usr/bin/dbus-send --system \ - --dest=org.freedesktop.NetworkManager \ - --type=method_call \ - /org/freedesktop/NetworkManager \ - org.freedesktop.NetworkManager.sleep - ;; - wake) - /usr/bin/dbus-send --system \ - --dest=org.freedesktop.NetworkManager \ - --type=method_call \ - /org/freedesktop/NetworkManager \ - org.freedesktop.NetworkManager.wake - ;; - *) - echo "usage: $0 {start|stop|restart|sleep|wake}" - ;; -esac -exit 0 - - - diff --git a/initscript/Debian/NetworkManager.in b/initscript/Debian/NetworkManager.in deleted file mode 100755 index 9cc254e..0000000 --- a/initscript/Debian/NetworkManager.in +++ /dev/null @@ -1,91 +0,0 @@ -#! /bin/sh -### BEGIN INIT INFO -# Provides: NetworkManager -# Required-Start: $remote_fs dbus hal -# Required-Stop: $remote_fs dbus hal -# Should-Start: $syslog -# Should-Stop: $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: network connection manager -# Description: Daemon for automatically switching network -# connections to the best available connection. -### END INIT INFO - -set -e - -prefix= prefix@ -exec_prefix= prefix@ -sbindir= sbindir@ -localstatedir= localstatedir@ - -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin -DESC="network connection manager" -NAME="NetworkManager" - -DAEMON=${sbindir}/$NAME - -PIDDIR=${localstatedir}/run/NetworkManager -PIDFILE=$PIDDIR/$NAME.pid - -USER=root - -# Gracefully exit if the package has been removed. -test -x $DAEMON || exit 0 - -. /lib/lsb/init-functions - -test -f /etc/default/NetworkManager && . /etc/default/NetworkManager - -# -# Function that starts the daemon/service. -# -d_start() { - if [ ! -d $PIDDIR ]; then - mkdir -p $PIDDIR - chown $USER:$USER $PIDDIR - fi - - start-stop-daemon --start --quiet --pidfile $PIDFILE \ - --oknodo --user $USER --exec $DAEMON -- $DAEMON_OPTS --pid-file $PIDFILE - -} - -# -# Function that stops the daemon/service. -# -d_stop() { - start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE \ - --oknodo --user $USER --exec $DAEMON - -} - - -case "$1" in - start) - log_daemon_msg "Starting $DESC" "$NAME" - d_start - log_end_msg $? - ;; - stop) - log_daemon_msg "Stopping $DESC" "$NAME" - d_stop - log_end_msg $? - ;; - restart|force-reload) - log_daemon_msg "Restarting $DESC" "$NAME" - d_stop - d_start - log_end_msg $? - ;; - status) - status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? - ;; - *) - echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2 - exit 1 - ;; -esac - -exit 0 - diff --git a/initscript/Mandriva/networkmanager.in b/initscript/Mandriva/networkmanager.in deleted file mode 100644 index b5374a0..0000000 --- a/initscript/Mandriva/networkmanager.in +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/sh -# -# NetworkManager: NetworkManager daemon -# -# chkconfig: - 98 02 -# description: This is a daemon for automatically switching network \ -# connections to the best available connection. -# -# processname: NetworkManager -# pidfile: /var/run/NetworkManager/NetworkManager.pid -# -### BEGIN INIT INFO -# Provides: networkmanager -# Required-Start: $network -# Required-Stop: $network -# Default-Start: 3 4 5 -# Default-Stop: 0 1 2 6 -# Short-Description: Daemon for automatically switching to best network connection. -# Description: This is a daemon for automatically switching network -# connections to the best available connection. -### END INIT INFO - -prefix= prefix@ -exec_prefix= prefix@ -sbindir= sbindir@ - -NETWORKMANAGER_BIN=${sbindir}/NetworkManager - -# Sanity checks. -[ -x $NETWORKMANAGER_BIN ] || exit 1 - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source network configuration -. /etc/sysconfig/network - -# so we can rearrange this easily -processname=NetworkManager -servicename=NetworkManager -pidfile=/var/run/NetworkManager/NetworkManager.pid - -RETVAL=0 - -start() -{ - echo $"Setting network parameters... " - sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1 - - if [ ! -e /var/lock/subsys/named ]; then - service named start >/dev/null 2>&1 - fi - - echo -n $"Starting NetworkManager daemon: " - daemon --check $servicename $processname --pid-file=$pidfile - RETVAL=$? - echo - if [ -n "${NETWORKWAIT}" ]; then - [ -z "${LINKDELAY}" ] && LINKDELAY=10 - echo -n $"Waiting for network..." - nm-online -q --timeout=$LINKDELAY || nm-online -q -x --timeout=30 - [ "$?" = "0" ] && success "network startup" || failure "network startup" - echo - [ -n "${NETWORKDELAY}" ] && /bin/sleep ${NETWORKDELAY} - fi - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicename -} - -stop() -{ - echo -n $"Stopping NetworkManager daemon: " - killproc -p $pidfile $servicename - 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 -p $pidfile $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 diff --git a/initscript/RedHat/NetworkManager.in b/initscript/RedHat/NetworkManager.in deleted file mode 100755 index e26e59e..0000000 --- a/initscript/RedHat/NetworkManager.in +++ /dev/null @@ -1,104 +0,0 @@ -#!/bin/sh -# -# NetworkManager: NetworkManager daemon -# -# chkconfig: - 23 84 -# description: This is a daemon for automatically switching network \ -# connections to the best available connection. -# -# processname: NetworkManager -# pidfile: /var/run/NetworkManager/NetworkManager.pid -# -### BEGIN INIT INFO -# Provides: network_manager $network -# Required-Start: messagebus -# Required-Stop: messagebus -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: start and stop NetworkManager -# Description: NetworkManager is a tool for easily managing network connections -### END INIT INFO - -prefix= prefix@ -exec_prefix= prefix@ -sbindir= sbindir@ - -NETWORKMANAGER_BIN=${sbindir}/NetworkManager - -# Sanity checks. -[ -x $NETWORKMANAGER_BIN ] || exit 1 - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source network configuration -. /etc/sysconfig/network - -# so we can rearrange this easily -processname=NetworkManager -servicename=NetworkManager -pidfile=/var/run/NetworkManager/NetworkManager.pid - -RETVAL=0 - -start() -{ - echo -n $"Setting network parameters... " - sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1 - success - echo - - echo -n $"Starting NetworkManager daemon: " - daemon --pidfile $pidfile --check $servicename $processname --pid-file=$pidfile - RETVAL=$? - echo - if [ -n "${NETWORKWAIT}" ]; then - [ -z "${LINKDELAY}" ] && LINKDELAY=10 - echo -n $"Waiting for network..." - nm-online -q --timeout=$LINKDELAY || nm-online -q -x --timeout=30 - [ "$?" = "0" ] && success "network startup" || failure "network startup" - echo - [ -n "${NETWORKDELAY}" ] && /bin/sleep ${NETWORKDELAY} - fi - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicename -} - -stop() -{ - echo -n $"Stopping NetworkManager daemon: " - killproc -p $pidfile $servicename - 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 -p $pidfile $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 diff --git a/initscript/SUSE/networkmanager.in b/initscript/SUSE/networkmanager.in deleted file mode 100644 index df2cd24..0000000 --- a/initscript/SUSE/networkmanager.in +++ /dev/null @@ -1,51 +0,0 @@ -#! /bin/sh - -### BEGIN INIT INFO -# Provides: networkmanager -# Required-Start: dbus haldaemon -# Default-Start: 3 5 -# Default-Stop: -# Description: NetworkManager, a network and wireless connection manager -### END INIT INFO - -sbindir= sbindir@ - -NETWORKMANAGER_BIN=${sbindir}/NetworkManager -test -x $NETWORKMANAGER_BIN || exit 5 - -. /etc/rc.status -rc_reset - -case "$1" in - start) - checkproc $NETWORKMANAGER_BIN - if [ $? = 0 ]; then - echo -n "NetworkManager already running" - rc_status -v - rc_exit - fi - echo -n "Starting the NetworkManager" - startproc $NETWORKMANAGER_BIN - rc_status -v - ;; - stop) - echo -n "Shutting down the NetworkManager" - killproc -TERM $NETWORKMANAGER_BIN - rc_status -v - ;; - restart) - $0 stop - $0 start - rc_status - ;; - status) - echo -n "Checking for the NetworkManager: " - checkproc $NETWORKMANAGER_BIN - rc_status -v - ;; - *) - echo "Usage: $0 {start|stop|status|restart}" - exit 1 - ;; -esac - diff --git a/initscript/Slackware/rc.networkmanager.in b/initscript/Slackware/rc.networkmanager.in deleted file mode 100644 index 6eed87e..0000000 --- a/initscript/Slackware/rc.networkmanager.in +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/sh -# -# NetworkManager: NetworkManager daemon -# -# description: This is a daemon for automatically switching network \ -# connections to the best available connection. \ -# -# processname: NetworkManager -# pidfile: /var/run/NetworkManager.pid -# - -prefix= prefix@ -exec_prefix= prefix@ -sbindir= sbindir@ - -NETWORKMANAGER_BIN=${sbindir}/NetworkManager - -# Sanity checks. -[ -x $NETWORKMANAGER_BIN ] || exit 0 - -PIDFILE=/var/run/NetworkManager.pid - -nm_start() -{ - if [ "`pgrep dbus-daemon`" = "" ]; then - echo "D-BUS must be running to start NetworkManager" - return - fi - - # Just in case the pidfile is still there, we may need to nuke it. - if [ -e "$PIDFILE" ]; then - rm -f $PIDFILE - fi - - echo "Starting NetworkManager daemon: $NETWORKMANAGER_BIN" - $NETWORKMANAGER_BIN -} - -nm_status() -{ - local pidlist=`cat $PIDFILE 2>/dev/null` - if [ -z "$pidlist" ]; then - return 1 - fi - local command=`ps -p $pidlist -o comm=` - if [ "$command" != 'NetworkManager' ]; then - return 1 - fi -} - -nm_stop() -{ - echo -en "Stopping NetworkManager: " - local pidlist=`cat $PIDFILE 2>/dev/null` - if [ ! -z "$pidlist" ]; then - kill $pidlist &>/dev/null - rm -f $PIDFILE &>/dev/null - fi - echo "stopped"; -} - -nm_restart() -{ - nm_stop - sleep 2 - nm_start -} - -case "$1" in -'start') - if ( ! nm_status ); then - nm_start - else - echo "NetworkManager is already running (will not start it twice)." - fi - ;; -'stop') - nm_stop - ;; -'restart') - nm_restart - ;; -'status') - if ( nm_status ); then - echo "NetworkManager is currently running" - else - echo "NetworkManager is not running." - fi - ;; -*) - echo "usage $0 start|stop|status|restart" -esac diff --git a/initscript/linexa/networkmanager.in b/initscript/linexa/networkmanager.in deleted file mode 100644 index 0d754c3..0000000 --- a/initscript/linexa/networkmanager.in +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -# Start the networkmanager daemon -# -# Author: Elias <elias linexa de> -# [2010-08-20] - -# Information about the daemon -title="networkmanager" # No spaces allowed in here -start_after="dbus" # dependencies for start-up -stop_after="xinetd" # dependencies for stop -runlevel="2" # start/stop in this runlevel -sequence="25" # "checkinstall networkmanager enable" - # will create links to: - # /etc/rc.d/rc${runlevel}.d/S${sequence}${title} - # /etc/rc.d/rc${runlevel}.d/S$((100 - ${sequence}))${title} - -# check whether daemon is running -# returns 0 if running, >0 if not -check() { - [ -f /var/run/NetworkManager.pid ] -} - -# start procedure -start() { - if check ; then - warning "${title} is already running. Type 'service restart ${title}'" # Issue a warning - else - /usr/sbin/NetworkManager & - evaluate_retval "Starting ${title}. " # Print [ done ] or [ failed ] depending on outcome - fi -} - -# stop procedure -stop() { - if check ; then # daemon is running - kill $(cat /var/run/NetworkManager.pid) - evaluate_retval "Stopping ${title}." # Print [ done ] or [ failed ] depending on outcome - else # daemon not running - warning "${title} is not running." # Issue a warning - fi -} - -# restart procedure -restart() { - stop - sleep 1 - start -} - -# reload action -reload() { - if check ; then # daemon is running - kill -HUP $(cat /var/run/NetworkManager.pid) &>/dev/null - evaluate_retval "Reloading ${title}." # Print [ done ] or [ failed ] depending on outcome - else # daemon not running - warning "${title} is not running." # Issue a warning - fi -} - -- 2.5.0
Attachment:
signature.asc
Description: This is a digitally signed message part