Your message dated Wed, 23 Dec 2009 22:02:20 +0000
with message-id <[email protected]>
and subject line Bug#372746: fixed in and 1.2.2-3
has caused the Debian Bug report #372746,
regarding Please apply attached patch to allow and to run in foreground
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
372746: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=372746
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: and
Version: 1.2.2-1
Severity: wishlist
Tags: patch

Hi,

the attached patch adds a '-f' switch to and(8) that causes it to stay in
the foreground. This is useful when running it under a service monitor like
runit.

Thanks

Andras

-- 
                 Andras Korn <korn at chardonnay.math.bme.hu>
                 <http://chardonnay.math.bme.hu/~korn/> QOTD:
                    Barium: what you do with dead chemists.
diff -u -r and-1.2.2/and.8.man and-1.2.2+fg/and.8.man
--- and-1.2.2/and.8.man 2006-06-11 14:24:31.752873281 +0200
+++ and-1.2.2+fg/and.8.man      2006-06-11 14:23:49.636154000 +0200
@@ -5,7 +5,7 @@
 
 .SH "SYNOPSIS"
 .B and
-.RB [ \-htvsx ]
+.RB [ \-htvsxf ]
 .RB [ \-i
 .IR interval ]
 .RB [ \-c
@@ -101,6 +101,10 @@
 Run in full operational mode, i.e. really renice or kill things.
 This is the default.
 
+.TP 0.5i
+.B \-f
+Foreground mode. Don't daemonize.
+
 .SH "SIGNALS"
 
 On
diff -u -r and-1.2.2/and.c and-1.2.2+fg/and.c
--- and-1.2.2/and.c     2004-04-05 21:19:01.000000000 +0200
+++ and-1.2.2+fg/and.c  2006-06-11 14:21:01.217289000 +0200
@@ -156,6 +156,7 @@
 struct {
   char hostname [512];
   int test;
+  int foreground;
   char *program;
   char *config_file;
   char *database_file;
@@ -179,6 +180,7 @@
 void set_defaults (int argc, char **argv)
 {
   and_config.test = 0;
+  and_config.foreground = 0;
   and_config.verbose = 0;
   and_config.to_stdout = 0;
   and_config.program = argv[0];
@@ -884,7 +886,7 @@
 
 void and_getopt (int argc, char** argv)
 {
-#define OPTIONS "c:d:i:vstxh"
+#define OPTIONS "c:d:i:vstxfh"
   int opt, value;
   opt = getopt(argc,argv,OPTIONS);
   while (opt != -1) {
@@ -921,12 +923,16 @@
     case 'x':
       and_config.test = 0;
       break;
+    case 'f':
+      and_config.foreground = 1;
+      break;
     case 'h':
       printf("auto nice daemon version %s (%s)\n"
             "%s [-v] [-s]  [-t] [-x] [-c configfile] [-d databasefile] [-i 
interval]\n"
             "-v: verbosity -v, -vv, -vvv etc\n"
             "-s: log to stdout (default is syslog, or debug.and)\n"
             "-x: really execute renices and kills (default)\n"
+             "-f: don't daemonize, stay in foreground\n"
             "-t: test configuration (don't really renice)\n"
             "-i interval: loop interval in seconds (default %i)\n"
             "-c configfile: specify config file (default %s)\n"
@@ -986,7 +992,11 @@
   if (and_config.test) {
     and_worker();
   } else {
-    if (fork() == 0) and_worker();
+    if (and_config.foreground) {
+      and_worker();
+    } else {
+      if (fork() == 0) and_worker();
+    }
   }
   return 0;
 }

--- End Message ---
--- Begin Message ---
Source: and
Source-Version: 1.2.2-3

We believe that the bug you reported is fixed in the latest version of
and, which is due to be installed in the Debian FTP archive:

and_1.2.2-3.diff.gz
  to main/a/and/and_1.2.2-3.diff.gz
and_1.2.2-3.dsc
  to main/a/and/and_1.2.2-3.dsc
and_1.2.2-3_i386.deb
  to main/a/and/and_1.2.2-3_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Barry deFreese <[email protected]> (supplier of updated and package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Wed, 23 Dec 2009 16:47:24 -0500
Source: and
Binary: and
Architecture: source i386
Version: 1.2.2-3
Distribution: unstable
Urgency: low
Maintainer: Debian QA Group <[email protected]>
Changed-By: Barry deFreese <[email protected]>
Description: 
 and        - Auto Nice Daemon
Closes: 372746 449941 532698
Changes: 
 and (1.2.2-3) unstable; urgency=low
 .
   * QA upload.
     + Set maintainer to Debian QA Group <[email protected]>.
   * Acknowledge NMUs.
   * Add Homepage field.
   * Update watch file to use SF redirector. (Closes: #449941).
   * Add -f support to run in foreground (Closes: #372746).
     + Thanks to Andras Korn for the patch!
   * Add support to build on GNU/Hurd. (Closes: #532698).
   * Bump debhelper build-dep and compat to 5.
   * Bump Standards Version to 3.8.3.
Checksums-Sha1: 
 552b14a03e6e44083cbb471cb3b4ea46ac7f6236 956 and_1.2.2-3.dsc
 e805015a767db5f990dae4d4a254fdaeac00114a 8174 and_1.2.2-3.diff.gz
 c9b86fe1881cb1c8953de9657feead362071da40 26346 and_1.2.2-3_i386.deb
Checksums-Sha256: 
 993db6738ec0fb0acf7d5400e630ccac4052fcdcb6feee27e2b88aa029dc3861 956 
and_1.2.2-3.dsc
 4ab7d73ba64992a7aa1af12970b6f347c51d4604b6de697d0d106942bcf083b2 8174 
and_1.2.2-3.diff.gz
 e60a4aa939f525a9f83e21612f81759a309ff1d21dd12468f450eed8e8845dfb 26346 
and_1.2.2-3_i386.deb
Files: 
 edc28f3d77d2710dbb6b480d3d69977b 956 misc extra and_1.2.2-3.dsc
 2d19519a30a4c0d37995c07f1f5eb139 8174 misc extra and_1.2.2-3.diff.gz
 50d0b8cb666cf7e975ff199718ae9780 26346 misc extra and_1.2.2-3_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAksykVgACgkQ5ItltUs5T34PJgCg2BsZBYalnxJVAs+VXpb8cfoh
nYYAoJlGyeWysK3D68aNWcRDyX1pG4iD
=7hHj
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to