debian/0000755000000000000000000000000011735116477007202 5ustar debian/README.Debian0000644000000000000000000000151211345702617011234 0ustar ps-watcher for Debian --------------------- 1. PROVIDE A CONFIGFILE ----------------------- Please provide a config file, usually /etc/ps-watcher.conf. Examples are located in /usr/share/doc/ps-watcher/examples/. 2. AUTOMATIC STARTUP -------------------- In order to avoid the startup of the daemon on an unconfigured machine, automatic startup, on boot, is disabled by default. To enable it just edit the file /etc/default/ps-watcher and set the "startup" variable to 1. 3. POSITION IN STARTUP SCRIPTS ------------------------------ If you want to keep track on daemon (restart if not running any more), you should start ps-watcher on startup after all daemons running and stop at first on shutdown. You can use update-rc.d to updated the postition in start-scripts. -- Jan Wagner Wed, 8 Nov 2006 22:44:24 +0100 debian/source/0000755000000000000000000000000011735116477010502 5ustar debian/source/format0000644000000000000000000000001411734526101011674 0ustar 3.0 (quilt) debian/patches/0000755000000000000000000000000011735116477010631 5ustar debian/patches/ps_binary0000644000000000000000000000143611734532303012533 0ustar 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? debian/patches/series0000644000000000000000000000001211734532303012024 0ustar ps_binary debian/control0000644000000000000000000000177311734645754010621 0ustar Source: ps-watcher Section: admin Priority: extra Maintainer: Jan Wagner Build-Depends: debhelper (>= 9) Build-Depends-Indep: autotools-dev, libconfig-inifiles-perl, perl-modules Homepage: http://ps-watcher.sourceforge.net/ 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}, ${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. The match patterns are Perl regular expressions which can refer to the process information via variables. . For example it can be used to ensure that a daemon is running, or is not running too many times. It can also be used to determine when a process has consumed too many resources, perhaps due to a memory leak. debian/default0000644000000000000000000000066110524557011010540 0ustar # Defaults for ps-watcher initscript # sourced by /etc/init.d/ps-watcher # installed at /etc/default/ps-watcher by the maintainer scripts # prevent startup without configuration file # set the below varible to 1 in order to allow ps-watcher to start # startup=1 # Specify your configfile here CONFIG="/etc/ps-watcher.conf" # Additional options that are passed to the Daemon. # here: check every 150 secs DAEMON_OPTS="--sleep 150" debian/watch0000644000000000000000000000007410523170165010220 0ustar version=3 http://sf.net/ps-watcher/ps-watcher-(.*)\.tar\.gz debian/postinst0000644000000000000000000000075311232373250010777 0ustar #!/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# debian/preinst0000755000000000000000000000035011735116154010602 0ustar #!/bin/sh set -e # generate correct pid file, for versions where was non or incorrect if [ "$1" = "upgrade" ] && [ "$2" ] && dpkg --compare-versions "$2" le "1.06-6"; then pidof ps-watcher > /var/run/ps-watcher.pid fi #DEBHELPER# debian/docs0000644000000000000000000000002110523164327010035 0ustar NEWS THANKS TODO debian/changelog0000644000000000000000000001150311735116154011044 0ustar ps-watcher (1.08-5) unstable; urgency=low * Fix comparation in preinst script, realy (Closes: #666097) -- Jan Wagner 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 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 Sun, 20 Jul 2008 13:43:55 +0200 ps-watcher (1.06-9) unstable; urgency=low * added Vcs- fields, moved Homepage into source header's field * bump standards version to 3.7.3 (no changes needed) * change Priority to extra since libconfig-inifiles-perl is also extra and we depend on it * remove whitespaces trailing whitespaces from changelog * add dpatch infrastructure * add 01_add_pidfile_support.dpatch to implement writing pidfiles into the daemon * adjust init script since the daemon supports writing pidfiles * make use of pidof in preinst * move copy of config.guess and and config.sub into config.status target -- Jan Wagner Thu, 03 Apr 2008 00:23:39 +0200 ps-watcher (1.06-8) unstable; urgency=low * fix clean target in rules -- Jan Wagner Thu, 08 Nov 2007 09:25:25 +0100 ps-watcher (1.06-7) unstable; urgency=low * update copyright * use native debhelper prerm and postinst script * make start-stop-daemon working instead of using kill * providing upgrade path via preinst -- Jan Wagner Wed, 4 Jul 2007 12:26:57 +0200 ps-watcher (1.06-6) unstable; urgency=medium * fix prerm and postinst to prevent trouble when updating -- Jan Wagner Thu, 8 Mar 2007 09:20:58 +0100 ps-watcher (1.06-5) unstable; urgency=medium * fix typo in init script which prevents from start -- Jan Wagner Wed, 28 Feb 2007 23:00:39 +0100 ps-watcher (1.06-4) unstable; urgency=medium * moved libsys-syslog-perl from Depends to Recommands and removed from Builddeps since Sys::Syslog is also provided by perl -- Jan Wagner Tue, 28 Nov 2006 12:01:46 +0100 ps-watcher (1.06-3) unstable; urgency=low * moved from binary-arch to binary-indep -- Jan Wagner Thu, 9 Nov 2006 14:08:15 +0100 ps-watcher (1.06-2) unstable; urgency=low * remove dh_strip from rules * adjust depencies (libconfig-inifiles-perl, libsys-syslog-perl) * modifying initscript to prevent to start without config file * provide own postinst and prerm scripts -- Jan Wagner Sat, 4 Nov 2006 21:38:44 +0100 ps-watcher (1.06-1) unstable; urgency=low * Initial release (Closes: #396953). -- Jan Wagner Fri, 3 Nov 2006 14:39:48 +0100 debian/source.lintian-overrides0000644000000000000000000000027411232373275014056 0ustar # 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 debian/copyright0000644000000000000000000000260011232714027011116 0ustar 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 Files: * Copyright: Copyright (C) 2000-2006 Rocky Bernstein License: GPL-2+ 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 (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public 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-2 file. debian/rules0000755000000000000000000000274111734527042010257 0ustar #!/usr/bin/make -f # written by Jan Wagner # # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 config.status: configure dh_testdir ifneq "$(wildcard /usr/share/misc/config.sub)" "" cp -f /usr/share/misc/config.sub config.sub endif ifneq "$(wildcard /usr/share/misc/config.guess)" "" cp -f /usr/share/misc/config.guess config.guess endif # Add here commands to configure the package. ./configure --prefix=/usr --mandir=\$${prefix}/share/man build: build-arch build-indep build-arch: build-stamp build-indep: build-stamp build-stamp: config.status dh_testdir # Add here commands to compile the package. $(MAKE) touch $@ 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 dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Add here commands to install the package into debian/ps-watcher. $(MAKE) DESTDIR=$(CURDIR)/debian/ps-watcher install # Build architecture-independent files here. binary-indep: build install dh_testdir dh_testroot dh_installchangelogs ChangeLog dh_installdocs dh_installexamples samples/* dh_installinit -- defaults 99 01 dh_link dh_compress dh_fixperms dh_perl dh_installdeb dh_gencontrol dh_md5sums dh_builddeb # Build architecture-dependent files here. binary-arch: binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install debian/init.d0000644000000000000000000000423511345702617010310 0ustar #! /bin/sh # Written by Miquel van Smoorenburg . # Modified for Debian # by Ian Murdock . # # Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl # /etc/init.d/ps-watcher: v1 2006/11/03 Jan Wagner ### BEGIN INIT INFO # Provides: ps-watcher # Required-Start: $local_fs $network $remote_fs $syslog # Required-Stop: $local_fs $network $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: start and stop the ps-watcher daemon # Description: monitoring a system via ps-like commands ### END INIT INFO PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/bin/ps-watcher NAME=ps-watcher DESC=ps-watcher test -x $DAEMON || exit 0 # Include ps-watcher defaults if available if [ -f /etc/default/ps-watcher ] ; then . /etc/default/ps-watcher fi set -e not_configured () { echo "#### WARNING ####" echo "ps-watcher won't be started/stopped unless it is configured" if [ "$1" != "stop" ] then echo "" echo "Please pease provide a configfile!" echo "See /usr/share/doc/ps-watcher/README.Debian*." fi echo "#################" exit 0 } # check if ps-watcher is configured or not if [ -f "/etc/default/ps-watcher" ] then . /etc/default/ps-watcher if [ "$startup" != "1" ] || [ ! -f $CONFIG ] then not_configured fi else not_configured fi case "$1" in start) echo -n "Starting $DESC: " start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ --exec $DAEMON -- -c $CONFIG --daemon $DAEMON_OPTS echo "$NAME." ;; stop) echo -n "Stopping $DESC: " start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid echo "$NAME." ;; restart|force-reload) echo -n "Restarting $DESC: " start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid sleep 1 start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ --exec $DAEMON -- -c $CONFIG --daemon $DAEMON_OPTS echo "$NAME." ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0 debian/compat0000644000000000000000000000000210522643710010364 0ustar 5 debian/NEWS0000644000000000000000000000060711232366574007701 0ustar 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