[svn-buildpackage] Tagging ps-watcher 1.08-5

This commit is contained in:
15 changed files with 155 additions and 142 deletions

10
debian/NEWS vendored Normal file
View file

@ -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 <waja@cyconet.org> Fri, 24 Jul 2009 19:16:09 +0200

View file

@ -4,7 +4,7 @@ ps-watcher for Debian
1. PROVIDE A CONFIGFILE 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/. located in /usr/share/doc/ps-watcher/examples/.
2. AUTOMATIC STARTUP 2. AUTOMATIC STARTUP

76
debian/changelog vendored
View file

@ -1,8 +1,80 @@
ps-watcher (1.06-10) UNRELEASED; urgency=low ps-watcher (1.08-5) unstable; urgency=low
* Fix comparation in preinst script, realy (Closes: #666097)
-- Jan Wagner <waja@cyconet.org> Thu, 29 Mar 2012 11:56:23 +0200
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 <waja@cyconet.org> 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 <waja@cyconet.org> 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 <waja@cyconet.org> 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 <waja@cyconet.org> 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 <waja@cyconet.org> 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 <waja@cyconet.org> Wed, 01 Oct 2008 11:05:25 +0200
ps-watcher (1.06-10) unstable; urgency=low
* bump copyright of packaging to 2008 * 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 <waja@localhost> Thu, 03 Apr 2008 10:29:21 +0200 -- Jan Wagner <waja@cyconet.org> Sun, 20 Jul 2008 13:43:55 +0200
ps-watcher (1.06-9) unstable; urgency=low ps-watcher (1.06-9) unstable; urgency=low

12
debian/control vendored
View file

@ -2,16 +2,16 @@ Source: ps-watcher
Section: admin Section: admin
Priority: extra Priority: extra
Maintainer: Jan Wagner <waja@cyconet.org> Maintainer: Jan Wagner <waja@cyconet.org>
Build-Depends: debhelper (>= 5), autotools-dev, dpatch Build-Depends: debhelper (>= 9)
Build-Depends-Indep: libconfig-inifiles-perl, perl-modules Build-Depends-Indep: autotools-dev, libconfig-inifiles-perl, perl-modules
Homepage: http://ps-watcher.sourceforge.net/ Homepage: http://ps-watcher.sourceforge.net/
Vcs-Browser: https://trac.cyconet.org/debian/browser/debian/ps-watcher Vcs-Browser: https://scm.uncompleted.org/projects/debian/repository/show/ps-watcher
Vcs-Svn: https://trac.cyconet.org/svn/debian/ps-watcher Vcs-Svn: https://scm.uncompleted.org/svn/debian/ps-watcher/trunk
Standards-Version: 3.7.3 Standards-Version: 3.9.3
Package: ps-watcher Package: ps-watcher
Architecture: all Architecture: all
Depends: ${perl:Depends}, libconfig-inifiles-perl Depends: ${perl:Depends}, ${misc:Depends}, libconfig-inifiles-perl, procps
Recommends: libsys-syslog-perl Recommends: libsys-syslog-perl
Description: monitoring a system via ps-like commands Description: monitoring a system via ps-like commands
This program runs the ps command periodically and triggers commands on matches. This program runs the ps command periodically and triggers commands on matches.

28
debian/copyright vendored
View file

@ -1,14 +1,19 @@
This package was debianized by Jan Wagner <waja@cyconet.org> on Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=196
Fri, 3 Nov 2006 14:39:48 +0100. Packaged-By: Jan Wagner <waja@cyconet.org>
Packaged-Date: Fri, 3 Nov 2006 14:39:48 +0100
Upstream-Name: ps-watcher
Upstream-Maintainer: Rocky Bernstein <rocky@panix.com>
Upstream-Source: http://ps-watcher.sf.net
It was downloaded from <http://sf.net/ps-watcher/> Files: *
Copyright: Copyright (C) 2000-2006 Rocky Bernstein <rocky@panix.com>
License: GPL-2+
Upstream Author: Rocky Bernstein <rocky@panix.com> Files: debian/*
Copyright: Copyright (C) 2006, 2008 Jan Wagner <waja@cyconet.org>
Copyright: (C) 2000-2006 Rocky Bernstein <rocky@panix.com> License: GPL-2+
License:
License: GPL-2+
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or 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 along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
On Debian systems, the complete text of the GNU General Public License On Debian systems, the complete text of the GNU General Public License can be
can be found in /usr/share/common-licenses/GPL file. found in /usr/share/common-licenses/GPL-2 file.
The Debian packaging is (C) 2006-2008 Jan Wagner <waja@cyconet.org> and
is licensed under the GPL, see `/usr/share/common-licenses/GPL'.

3
debian/init.d vendored
View file

@ -37,7 +37,7 @@ not_configured () {
then then
echo "" echo ""
echo "Please pease provide a configfile!" 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 fi
echo "#################" echo "#################"
exit 0 exit 0
@ -74,7 +74,6 @@ case "$1" in
sleep 1 sleep 1
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
--exec $DAEMON -- -c $CONFIG --daemon $DAEMON_OPTS --exec $DAEMON -- -c $CONFIG --daemon $DAEMON_OPTS
/bin/pidof $DAEMON > /var/run/$NAME.pid
echo "$NAME." echo "$NAME."
;; ;;
*) *)

View file

@ -1 +0,0 @@
01_add_pidfile_support.dpatch

View file

@ -1,108 +0,0 @@
#!/bin/sh /usr/share/dpatch/dpatch-run
## 01_add_pidfile_support.dpatch by Jan Wagner <waja@cyconet.org>
## with hints by Sebastian Harl <sh@tokkee.org> and
## Alexander Wirt <formorer@formorer.de>
##
## 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 = <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 = <FH>;
+ 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.

15
debian/patches/ps_binary vendored Normal file
View file

@ -0,0 +1,15 @@
From: Jan Wagner <waja@cyconet.org>
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?

1
debian/patches/series vendored Normal file
View file

@ -0,0 +1 @@
ps_binary

17
debian/postinst vendored Normal file
View file

@ -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#

4
debian/preinst vendored
View file

@ -2,7 +2,7 @@
set -e set -e
# generate correct pid file, for versions where was non or incorrect # generate correct pid file, for versions where was non or incorrect
if [ "$1" = "upgrade" ] && [ "$2" ] && dpkg --compare-versions "$2" <= "1.06-6"; then if [ "$1" = "upgrade" ] && [ "$2" ] && dpkg --compare-versions "$2" le "1.06-6"; then
/bin/pidof ps-watcher > /var/run/ps-watcher.pid pidof ps-watcher > /var/run/ps-watcher.pid
fi fi
#DEBHELPER# #DEBHELPER#

16
debian/rules vendored
View file

@ -4,9 +4,7 @@
# Uncomment this to turn on verbose mode. # Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1 #export DH_VERBOSE=1
include /usr/share/dpatch/dpatch.make config.status: configure
config.status: patch-stamp configure
dh_testdir dh_testdir
ifneq "$(wildcard /usr/share/misc/config.sub)" "" ifneq "$(wildcard /usr/share/misc/config.sub)" ""
cp -f /usr/share/misc/config.sub config.sub cp -f /usr/share/misc/config.sub config.sub
@ -17,7 +15,10 @@ endif
# Add here commands to configure the package. # Add here commands to configure the package.
./configure --prefix=/usr --mandir=\$${prefix}/share/man ./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 build-stamp: config.status
dh_testdir dh_testdir
@ -26,10 +27,11 @@ build-stamp: config.status
touch $@ touch $@
clean: unpatch clean:
dh_testdir dh_testdir
dh_testroot dh_testroot
rm -f build-stamp rm -f build-stamp
rm -f config.guess config.sub
# Add here commands to clean up after the build process. # Add here commands to clean up after the build process.
[ ! -f Makefile ] || $(MAKE) clean [ ! -f Makefile ] || $(MAKE) clean
@ -51,7 +53,7 @@ binary-indep: build install
dh_installchangelogs ChangeLog dh_installchangelogs ChangeLog
dh_installdocs dh_installdocs
dh_installexamples samples/* dh_installexamples samples/*
dh_installinit -- defaults 40 dh_installinit -- defaults 99 01
dh_link dh_link
dh_compress dh_compress
dh_fixperms dh_fixperms
@ -62,7 +64,7 @@ binary-indep: build install
dh_builddeb dh_builddeb
# Build architecture-dependent files here. # Build architecture-dependent files here.
binary-arch: build install binary-arch:
binary: binary-indep binary-arch binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install .PHONY: build clean binary-indep binary-arch binary install

3
debian/source.lintian-overrides vendored Normal file
View file

@ -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

1
debian/source/format vendored Normal file
View file

@ -0,0 +1 @@
3.0 (quilt)