1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-18 20:10:20 +01:00

Moved from generated init files to static.

Let the maintainers do their choices, instead of jump into ideas about
how init files should looks like.

Adjusted gitignore file.
This commit is contained in:
2020-08-25 20:38:00 +02:00
parent 9cefcee94b
commit 3499631070
11 changed files with 37 additions and 100 deletions

26
.gitignore vendored
View File

@@ -1,19 +1,15 @@
.git
wicd.egg-info/
*.bak
**/*.pyc
__pycache__/
*.py[cod]
build/
dist/
sdist/
*.egg-info/
MANIFEST
.venv/
.vscode/
.bzr/
experimental.wpr
install.log
uninstall.log
.bzrignore
vcsinfo.py
build
build/*
init/*/*
wpath.py*
man/wicd-curses.8
man/wicd-manager-settings.conf.5
man/wicd-wired-settings.conf.5
@@ -29,8 +25,4 @@ scripts/wicd
scripts/wicd-client
scripts/wicd-curses
translations/*
wicd/wpath.py
*tags
dist/
MANIFEST
debian/

View File

@@ -5,7 +5,7 @@
. /etc/rc.conf
. /etc/rc.d/functions
WICD_BIN="%SBIN%wicd"
WICD_BIN="/usr/sbin/wicd"
if [ -f /var/run/wicd/wicd.pid ]; then
PID="$(cat /var/run/wicd/wicd.pid)"

View File

@@ -19,10 +19,10 @@ PATH=/usr/sbin:/usr/bin:/sbin:/bin
DESC="Network connection manager"
NAME=wicd
RUNDIR=/var/run/$NAME
DAEMON=%SBIN%$NAME
DAEMON=/usr/sbin/$NAME
DAEMON_ARGS=""
PIDFILE=$RUNDIR/wicd.pid
SCRIPTNAME=%INIT%%INITFILENAME%
SCRIPTNAME=/etc/init.d/wicd
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

View File

@@ -2,8 +2,8 @@
# Copyright 1999-2020 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
WICD_DAEMON=%SBIN%wicd
WICD_PIDFILE=%PIDFILE%
WICD_DAEMON=/usr/sbin/wicd
WICD_PIDFILE=/run/wicd/wicd.pid
depend() {
need dbus

View File

@@ -7,7 +7,7 @@
# description: wicd wireless/wired internet connection daemon
#
# processname: wicd
# pidfile: %PIDFILE%
# pidfile: /var/run/wicd/wicd.pid
#
. /lib/lsb/init-functions $1

View File

@@ -8,7 +8,7 @@
#
# processname: wicd
# config:
# pidfile: %PIDFILE%
# pidfile: /var/run/wicd/wicd.pid
#
# $Id: template.init 9689 2008-03-27 16:15:39Z patrys $
@@ -19,7 +19,7 @@
# Get service config - may override defaults
# [ -f /etc/sysconfig/wicd ] && . /etc/sysconfig/wicd
WICD_BIN=%SBIN%wicd
WICD_BIN=/usr/sbin/wicd
start() {
# Check if the service is already running?

View File

@@ -9,9 +9,9 @@
. /etc/rc.d/init.d/functions
WICD_BIN=%SBIN%wicd
WICD_BIN=/usr/sbin/wicd
pidfile=%PIDFILE%
pidfile=/var/run/wicd/wicd.pid
servicename=wicd
processname=wicd
start()

View File

@@ -4,8 +4,8 @@
# Start/stop/restart the Wicd daemon
# This is defined in /usr/lib/python2.6/site-packages/wicd/wpath.py
PIDFILE="%PIDFILE%"
DAEMON="%SBIN%wicd"
PIDFILE="/var/run/wicd/wicd.pid"
DAEMON="/usr/sbin/wicd"
# Define start and stop functions

View File

@@ -9,7 +9,7 @@
# Description: wicd, a wired and wireless connection manager.
### END INIT INFO
WICD_BIN=%SBIN%wicd
WICD_BIN=/usr/sbin/wicd
test -x $WICD_BIN || exit 5
. /etc/rc.status

View File

@@ -1,53 +0,0 @@
#!/bin/sh
# /etc/init.d/wicd
# Start/stop/restart the Wicd daemon
# Modified the Slackware default init script for use
# where the distro is not detected.
# This is defined in /usr/lib/python2.5/site-packages/wicd/wpath.py
PIDFILE="%PIDFILE%"
# Define start and stop functions
wicd_start() {
if [ -e $PIDFILE ]; then
echo "Wicd appears to already be running."
echo "If this is not the case, then remove "
echo "$PIDFILE and try again..."
exit 1
else
echo "Starting wicd daemon..."
%SBIN%wicd 2>/dev/null 1>&2
fi
}
wicd_stop() {
echo "Stopping wicd daemon..."
if [ -e $PIDFILE ]; then
kill $(cat $PIDFILE) 2>/dev/null
rm -f $PIDFILE 2>/dev/null
else
killall wicd-client 2>/dev/null
fi
}
# See how we were called and take appropriate action
case $1 in
start)
wicd_start
;;
stop)
wicd_stop
;;
restart)
wicd_stop
wicd_start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac

View File

@@ -304,16 +304,20 @@ class configure(Command):
def distro_check(self):
print("Distro is: " + self.distro)
if self.distro is None and self.detected_distro != 'FAIL':
self.distro = self.detected_distro
if self.distro in ['sles', 'suse']:
self.init = '/etc/init.d/'
self.initfile = 'init/suse/wicd'
self.initfile = 'data/init/suse/wicd'
elif self.distro in ['redhat', 'centos', 'fedora']:
self.init = '/etc/rc.d/init.d/'
self.initfile = 'init/redhat/wicd'
self.initfile = 'data/init/redhat/wicd'
self.pidfile = '/var/run/wicd.pid'
elif self.distro in ['slackware', 'slamd64', 'bluewhite64']:
self.init = '/etc/rc.d/'
self.initfile = 'init/slackware/rc.wicd'
self.initfile = 'data/init/slackware/rc.wicd'
self.docdir = '/usr/doc/wicd-%s' % VERSION_NUM
self.mandir = '/usr/man/'
self.no_install_acpi = True
@@ -323,31 +327,25 @@ class configure(Command):
self.loggroup = "adm"
self.logperms = "0640"
self.init = '/etc/init.d/'
self.initfile = 'init/debian/wicd'
self.initfile = 'data/init/debian/wicd'
elif self.distro in ['arch']:
self.init = '/etc/rc.d/'
self.initfile = 'init/arch/wicd'
self.initfile = 'data/init/arch/wicd'
elif self.distro in ['gentoo']:
self.init = '/etc/init.d/'
self.initfile = 'init/gentoo/wicd'
self.initfile = 'data/init/gentoo/wicd'
elif self.distro in ['pld']:
self.init = '/etc/rc.d/init.d/'
self.initfile = 'init/pld/wicd'
self.initfile = 'data/init/pld/wicd'
elif self.distro in ['crux']:
self.init = '/etc/rc.d/'
elif self.distro in ['lunar']:
self.init = '/etc/init.d/'
self.initfile = 'init/lunar/wicd'
self.initfile = 'data/init/lunar/wicd'
else:
if self.distro == 'auto':
print("NOTICE: Automatic distro detection found: %s, retrying "
"with that..." % self.ddistro)
self.distro = self.ddistro
self.distro_check()
else:
print("WARNING: Distro detection failed!")
self.no_install_init = True
self.distro_detect_failed = True
log.warn("WARNING: Distro detection failed!")
self.no_install_init = True
self.distro_detect_failed = True
def finalize_options(self):
self.distro_check()