debian: fix issues with initscript

This commit is contained in:
Michael Stapelberg 2009-08-18 00:11:04 +02:00
parent 2b12cfe4e2
commit 56312001de
4 changed files with 25 additions and 16 deletions

12
debian/changelog vendored
View File

@ -1,10 +1,12 @@
i3status (1.3-1) unstable; urgency=low
i3status (1.2-3) unstable; urgency=low
* Correctly handle order of items when running for dzen2
* Implement getting the IPv6 address which currently has connectivity
* Lots of fixes for FreeBSD
* debian: Correct dependencies in /etc/init.d/i3status-wmii (Closes: #541626)
* debian: init script should not require root priviledges even to get the
usage information (Closes: #541627)
* debian: better error message when i3status-wmii is not enabled using
/etc/defaults/i3status-wmii (Closes: #541628)
-- Michael Stapelberg <michael@stapelberg.de> Sun, 02 Aug 2009 19:59:51 +0200
-- Michael Stapelberg <michael@stapelberg.de> Mon, 17 Aug 2009 14:57:49 +0200
i3status (1.2-2) unstable; urgency=low

3
debian/control vendored
View File

@ -16,4 +16,5 @@ Recommends: dzen2 | wmii
Description: Generates a status line for dzen2 or wmii
i3status is a program running in background, feeding dzen2 or filling up
wmii's status bar using wmiis plan9 pseudo file system (therefore, you
need 9pfs).
need 9pfs) by combining several system information (current IP addresses,
battery status, date/time, system load, etc.).

View File

@ -2,37 +2,43 @@
#
### BEGIN INIT INFO
# Provides: i3status-wmii
# Required-Start:
# Required-Stop:
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Generates a status line for wmii
# Description: Generates a status line for wmii
# Description: Combines several system information into a status line for
# wmii.
### END INIT INFO
# For the pidfile, you must be root. i3status itself runs as user just fine
need_root() {
# For the pidfile, you must be root. i3status itself works as user
[ $(id -ru) -eq 0 ] || { echo "You need to be root"; exit 1; }
}
[ -f /etc/default/i3status-wmii ] && . /etc/default/i3status-wmii
if [ "$I3STATUS_WMII_ENABLE" != "yes" ]
then
echo "Not starting i3status-wmii (Disabled in /etc/default/i3status-wmii)"
echo "Not starting i3status-wmii (Not enabled in /etc/default/i3status-wmii)"
exit 0
fi
. /lib/lsb/init-functions
case "$1" in
start) log_daemon_msg "Starting wmii status bar filler" "i3status-wmii"
start) need_root
log_daemon_msg "Starting wmii status bar filler" "i3status-wmii"
start-stop-daemon --start --background --quiet --make-pidfile --pidfile /var/run/i3status-wmii.pid --name i3status-wmii --startas /usr/bin/i3status-wmii
log_end_msg $?
;;
stop) log_daemon_msg "Stopping wmii status bar filler" "i3status-wmii"
stop) need_root
log_daemon_msg "Stopping wmii status bar filler" "i3status-wmii"
start-stop-daemon --stop --quiet --pidfile /var/run/i3status-wmii.pid --name i3status-wmii
log_end_msg $?
;;
restart|reload|force-reload) log_daemon_msg "Restarting wmii status bar filler" "i3status-wmii"
restart|reload|force-reload) need_root
log_daemon_msg "Restarting wmii status bar filler" "i3status-wmii"
start-stop-daemon --stop --retry 5 --quiet --pidfile /var/run/i3status-wmii.pid --name i3status-wmii
start-stop-daemon --start --background --quiet --make-pidfile --pidfile /var/run/i3status-wmii.pid --name i3status-wmii --startas /usr/bin/i3status-wmii
;;

2
debian/rules vendored
View File

@ -36,7 +36,7 @@ install: build
dh_installdirs
$(MAKE) DESTDIR=$(CURDIR)/debian/i3status/ install
install -m 755 $(CURDIR)/i3status-wmii $(CURDIR)/debian/i3status/usr/bin/i3status-wmii
dh_link usr/share/man/man1/i3status.1 usr/share/man/man1/i3status-wmii.1
# Build architecture-independent files here.
binary-indep: build install