diff --git a/debian/NEWS b/debian/NEWS new file mode 100644 index 0000000..65a664b --- /dev/null +++ b/debian/NEWS @@ -0,0 +1,10 @@ +ps-watcher (1.08-1) unstable; urgency=low + + * moved startup to the end of the boot process and terminating to the + beginning of the shutdown process + + If you modified the order of ps-watcher runlevel scripts for your own, this + adjustment will not happen automatically and you have to handle it for + yourself. + + -- Jan Wagner Fri, 24 Jul 2009 19:16:09 +0200 diff --git a/debian/README.Debian b/debian/README.Debian index a0dfc7b..9ee3fa9 100644 --- a/debian/README.Debian +++ b/debian/README.Debian @@ -4,7 +4,7 @@ ps-watcher for Debian 1. PROVIDE A CONFIGFILE ----------------------- -Please provide a config file, usualy /etc/ps-watcher.conf. Examples are +Please provide a config file, usually /etc/ps-watcher.conf. Examples are located in /usr/share/doc/ps-watcher/examples/. 2. AUTOMATIC STARTUP diff --git a/debian/changelog b/debian/changelog index e714bb1..2a31894 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,74 @@ -ps-watcher (1.06-10) UNRELEASED; urgency=low +ps-watcher (1.08-4) unstable; urgency=low + + * Depend on procps, cause we need /bin/ps, thanks to Cristian Ionescu-Idbohrn + (Closes: #666097) + + -- Jan Wagner Wed, 28 Mar 2012 19:28:35 +0200 + +ps-watcher (1.08-3) unstable; urgency=low + + * Bump Standards-Version to 3.9.3, no changes needed + * Raise debhelper version to 9 + * Switch packaging format to "3.0 (quilt)" + * Add build-arch and build-indep targets to debian/rules + * Add patches/ps_binary to set ps_prog to "/bin/ps", thank to Gregory Davis + (Closes: 645791) + + -- Jan Wagner Wed, 28 Mar 2012 08:53:20 +0200 + +ps-watcher (1.08-2) unstable; urgency=low + + * Add "Copyright" to all copyrights in debian/copyright + * Bump Standards-Version to 3.8.4, no changes needed + * Migrate Vcs-Fields over to scm.uncompleted.org + * Add 1.0 to debian/source/format + * refer README.Debian* in initscript (Closes: #523405) + + -- Jan Wagner Wed, 10 Mar 2010 12:44:44 +0100 + +ps-watcher (1.08-1) unstable; urgency=low + + * new upstream release + - pidfile support + - darwin support + * remove dpatch infrastructure + * moved initscritps to S99 and K01, thanks Tim Miller Dyck (Closes: #508189) + * created NEWS.Debian + * bump standards version to 3.8.2 (no changes needed) + * calling pidof in preinst without absolute path + * adjust lintian overrides for config* files + + -- Jan Wagner Fri, 24 Jul 2009 19:12:00 +0200 + +ps-watcher (1.07-1) unstable; urgency=low + + * new upstream release + - improve logfile handling + - new sample config file using perl-action + - minor typo fixes + + -- Jan Wagner Thu, 19 Feb 2009 17:24:47 +0100 + +ps-watcher (1.06-11) unstable; urgency=low + + * removed use of pidof from restart|force-reload init-script target, + since daemon has pidfile support and it never worked anyways + (Closes: #500741) + + -- Jan Wagner Wed, 01 Oct 2008 11:05:25 +0200 + +ps-watcher (1.06-10) unstable; urgency=low * bump copyright of packaging to 2008 + * Updating standards version to 3.8.0, no changes needed + * implement machine-interpretable copyright file + * move autotools-dev to Build-Depends-Indep + * cleanup rules a bit + * create lintian override for "outdated-autotools-helper-file", which we + copy over from autotools-dev + * add ${misc:Depends} to Depends - -- Jan Wagner Thu, 03 Apr 2008 10:29:21 +0200 + -- Jan Wagner Sun, 20 Jul 2008 13:43:55 +0200 ps-watcher (1.06-9) unstable; urgency=low diff --git a/debian/control b/debian/control index 850af30..d123bab 100644 --- a/debian/control +++ b/debian/control @@ -2,16 +2,16 @@ Source: ps-watcher Section: admin Priority: extra Maintainer: Jan Wagner -Build-Depends: debhelper (>= 5), autotools-dev, dpatch -Build-Depends-Indep: libconfig-inifiles-perl, perl-modules +Build-Depends: debhelper (>= 9) +Build-Depends-Indep: autotools-dev, libconfig-inifiles-perl, perl-modules Homepage: http://ps-watcher.sourceforge.net/ -Vcs-Browser: https://trac.cyconet.org/debian/browser/debian/ps-watcher -Vcs-Svn: https://trac.cyconet.org/svn/debian/ps-watcher -Standards-Version: 3.7.3 +Vcs-Browser: https://scm.uncompleted.org/projects/debian/repository/show/ps-watcher +Vcs-Svn: https://scm.uncompleted.org/svn/debian/ps-watcher/trunk +Standards-Version: 3.9.3 Package: ps-watcher Architecture: all -Depends: ${perl:Depends}, libconfig-inifiles-perl +Depends: ${perl:Depends}, ${misc:Depends}, libconfig-inifiles-perl, procps Recommends: libsys-syslog-perl Description: monitoring a system via ps-like commands This program runs the ps command periodically and triggers commands on matches. diff --git a/debian/copyright b/debian/copyright index 5699952..cf5da2f 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,14 +1,19 @@ -This package was debianized by Jan Wagner on -Fri, 3 Nov 2006 14:39:48 +0100. +Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=196 +Packaged-By: Jan Wagner +Packaged-Date: Fri, 3 Nov 2006 14:39:48 +0100 +Upstream-Name: ps-watcher +Upstream-Maintainer: Rocky Bernstein +Upstream-Source: http://ps-watcher.sf.net -It was downloaded from +Files: * +Copyright: Copyright (C) 2000-2006 Rocky Bernstein +License: GPL-2+ -Upstream Author: Rocky Bernstein - -Copyright: (C) 2000-2006 Rocky Bernstein - -License: +Files: debian/* +Copyright: Copyright (C) 2006, 2008 Jan Wagner +License: GPL-2+ +License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -23,8 +28,5 @@ License: along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -On Debian systems, the complete text of the GNU General Public License -can be found in /usr/share/common-licenses/GPL file. - -The Debian packaging is (C) 2006-2008 Jan Wagner and -is licensed under the GPL, see `/usr/share/common-licenses/GPL'. + On Debian systems, the complete text of the GNU General Public License can be + found in /usr/share/common-licenses/GPL-2 file. diff --git a/debian/init.d b/debian/init.d index dfadeb5..093cc77 100644 --- a/debian/init.d +++ b/debian/init.d @@ -37,7 +37,7 @@ not_configured () { then echo "" echo "Please pease provide a configfile!" - echo "See /usr/share/doc/ps-watcher/README.Debian.gz." + echo "See /usr/share/doc/ps-watcher/README.Debian*." fi echo "#################" exit 0 @@ -74,7 +74,6 @@ case "$1" in sleep 1 start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ --exec $DAEMON -- -c $CONFIG --daemon $DAEMON_OPTS - /bin/pidof $DAEMON > /var/run/$NAME.pid echo "$NAME." ;; *) diff --git a/debian/patches/00list b/debian/patches/00list deleted file mode 100644 index 4b77285..0000000 --- a/debian/patches/00list +++ /dev/null @@ -1 +0,0 @@ -01_add_pidfile_support.dpatch diff --git a/debian/patches/01_add_pidfile_support.dpatch b/debian/patches/01_add_pidfile_support.dpatch deleted file mode 100644 index 7167245..0000000 --- a/debian/patches/01_add_pidfile_support.dpatch +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/sh /usr/share/dpatch/dpatch-run -## 01_add_pidfile_support.dpatch by Jan Wagner -## with hints by Sebastian Harl and -## Alexander Wirt -## -## DP: add pidfile support to ps-watcher - - ---- ps-watcher-1.06/ps-watcher.in.in 2007-07-04 21:34:23.000000000 +0200 -+++ ps-watcher-1.06/ps-watcher.in.in 2008-04-02 18:16:45.000000000 +0200 -@@ -23,8 +23,11 @@ - - use vars qw($program $ps_cmd $ps_cmdfull $ps_fullcmd_fmt @ps_vars $ps_dvars - $0 $logopened $ps_args_fmt $args -- $count $pid $command $ps_arg_opts $DEVNULL %opts -+ $count $pid $command $ps_arg_opts $DEVNULL %opts $PIDFILE - ); -+ -+$PIDFILE = "/var/run/ps-watcher.pid"; -+ - use strict; - BEGIN { require 5.00503 } - -@@ -130,6 +133,7 @@ - sub read_config($); - sub check_config_file($); - sub run_trigger($$$); -+sub check_pid(); - - init(); - process_options(); -@@ -147,7 +151,12 @@ - } - - if ($opts{daemon}) { -- daemonize(); -+ if (! check_pid()) { -+ exit 1; -+ } -+ if (! daemonize()) { -+ exit 1; -+ } - } - - install_handlers(); -@@ -584,14 +593,62 @@ - exit 10; - } - -+sub check_pid() { -+ if (-f $PIDFILE) { -+ if (open(PID,$PIDFILE)) { -+ my $pid = ; -+ if (!close(PID)) { -+ logger("Unable to close file handle PID for file '$PIDFILE': $!"); -+ return; -+ } -+ if (-f "/proc/$pid/stat") { -+ if (open(FH,"/proc/$pid/stat")) { -+ my $line = ; -+ if (!close(FH)) { -+ logger("Unable to close file handle FH for file '/proc/$pid/stat': $!"); -+ return; -+ } -+ if ($line =~ /\d+[^(]*\((.*)\)\s*/) { -+ my $process = $1; -+ if ($process =~ /^$program$/) { -+ logger("$program already running at PID $pid; exiting."); -+ exit(0); -+ } -+ } -+ } else { -+ logger("Unable to open file handle FH for file '/proc/$pid/stat': $!"); -+ return; -+ } -+ } else { -+ logger("Removing stale PID file."); -+ unlink($PIDFILE); -+ } -+ }else{ -+ logger("Unable to open file handle PID for file '$PIDFILE': $!"); -+ return; -+ } -+ } -+ return 1; -+} - - sub daemonize() { - chdir '/' or die "Can't chdir to /: $!"; - defined(my $pid = fork) or die "Can't fork: $!"; - exit 0 if $pid; -+ if (open(FH,">$PIDFILE")) { -+ print FH $$; -+ if (!close(FH)) { -+ logger("Unable to close file handle FH for file '$PIDFILE': $!"); -+ return; -+ } -+ } else { -+ logger("Unable to open file handle FH for file '$PIDFILE': $!"); -+ return; -+ } - use POSIX qw(setsid); - setsid() or die "Can't start a new session: $!"; - umask 0; -+ return 1; - } - - # Time configuration file was last read. diff --git a/debian/patches/ps_binary b/debian/patches/ps_binary new file mode 100644 index 0000000..a5d1b8e --- /dev/null +++ b/debian/patches/ps_binary @@ -0,0 +1,15 @@ +From: Jan Wagner +Subject: Patch path of ps, so we don't need to have the binary installed on compiletime +Index: ps-watcher-1.08/ps-watcher.in.in +=================================================================== +--- ps-watcher-1.08.orig/ps-watcher.in.in 2012-03-28 08:37:45.000000000 +0200 ++++ ps-watcher-1.08/ps-watcher.in.in 2012-03-28 08:38:13.000000000 +0200 +@@ -339,7 +339,7 @@ + $opts{syslog} = 1; # Log errors to syslog + $opts{logfile} = $DEVNULL; + $opts{daemon} = 1; # Run as daemon; +- $opts{ps_prog} = '@PS@'; # Where is ps? ++ $opts{ps_prog} = '/bin/ps'; # Where is ps? + $opts{ps_pid_opts} = '@PS_PID_OPTS@'; # How do I get pids and commands? + + $ps_arg_opts = '@PS_ARGS@'; # How do I get full process command? diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..0d7b32d --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +ps_binary diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..e44e87a --- /dev/null +++ b/debian/postinst @@ -0,0 +1,17 @@ +#!/bin/sh + +set -e + +if [ "$1" = "configure" ] && [ "$2" ] && dpkg --compare-versions "$2" lt "1.08-1"; then + if [ -e /etc/rc2.d/S40ps-watcher ] && \ + [ -e /etc/rc3.d/S40ps-watcher ] && \ + [ -e /etc/rc4.d/S40ps-watcher ] && \ + [ -e /etc/rc5.d/S40ps-watcher ] && \ + [ -e /etc/rc0.d/K40ps-watcher ] && \ + [ -e /etc/rc1.d/K40ps-watcher ] && \ + [ -e /etc/rc6.d/K40ps-watcher ]; then + update-rc.d -f ps-watcher remove >/dev/null + fi +fi + +#DEBHELPER# diff --git a/debian/preinst b/debian/preinst index 36daa0b..0bb90a1 100755 --- a/debian/preinst +++ b/debian/preinst @@ -3,6 +3,6 @@ set -e # generate correct pid file, for versions where was non or incorrect if [ "$1" = "upgrade" ] && [ "$2" ] && dpkg --compare-versions "$2" <= "1.06-6"; then - /bin/pidof ps-watcher > /var/run/ps-watcher.pid + pidof ps-watcher > /var/run/ps-watcher.pid fi #DEBHELPER# diff --git a/debian/rules b/debian/rules index 33df5d5..9122b01 100755 --- a/debian/rules +++ b/debian/rules @@ -4,9 +4,7 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -include /usr/share/dpatch/dpatch.make - -config.status: patch-stamp configure +config.status: configure dh_testdir ifneq "$(wildcard /usr/share/misc/config.sub)" "" cp -f /usr/share/misc/config.sub config.sub @@ -17,7 +15,10 @@ endif # Add here commands to configure the package. ./configure --prefix=/usr --mandir=\$${prefix}/share/man -build: build-stamp +build: build-arch build-indep +build-arch: build-stamp +build-indep: build-stamp + build-stamp: config.status dh_testdir @@ -26,10 +27,11 @@ build-stamp: config.status touch $@ -clean: unpatch +clean: dh_testdir dh_testroot rm -f build-stamp + rm -f config.guess config.sub # Add here commands to clean up after the build process. [ ! -f Makefile ] || $(MAKE) clean @@ -51,7 +53,7 @@ binary-indep: build install dh_installchangelogs ChangeLog dh_installdocs dh_installexamples samples/* - dh_installinit -- defaults 40 + dh_installinit -- defaults 99 01 dh_link dh_compress dh_fixperms @@ -62,7 +64,7 @@ binary-indep: build install dh_builddeb # Build architecture-dependent files here. -binary-arch: build install +binary-arch: binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install diff --git a/debian/source.lintian-overrides b/debian/source.lintian-overrides new file mode 100644 index 0000000..01dd852 --- /dev/null +++ b/debian/source.lintian-overrides @@ -0,0 +1,3 @@ +# we copy the files over from autotools-dev +ps-watcher source: ancient-autotools-helper-file config.sub 2001-08-13 +ps-watcher source: ancient-autotools-helper-file config.guess 2002-07-23 diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt)