tag 460514 + patch
thanks

Hi,

On Sun, Jan 13, 2008 at 05:38:59PM +0100, Javier Fernández-Sanguino Peña wrote:
> Ummm... there are several issues here, you should report them separately:

Ok, I'll have a closer look at LSB what return code should be given if
/etc/init.d/cron start fails and will eventually report it as own bug.

> > a) The usage of /etc/crond.pid violates the FHS and therefore the Debian
> >    Policy Manual, section 9.1.1
> 
> Your architecture's /usr/include/paths.h (this is provided by the
> libc6-dev)

Well, it's libc0.1 on Debian GNU/kFreeBSD, but it has the same source
package as libc6: glibc.

> header is missing the following line:
> 
> #define    _PATH_VARRUN "/var/run/"

Nope:

$ fgrep _PATH_VARRUN /usr/include/paths.h
#define _PATH_VARRUN    "/var/run/"

There also seems to be only one further such bug in the BTS:
http://merkel.debian.org/~don/cgi/search.cgi?phrase=_PATH_VARRUN&search=search&skip=0&order_field=&order_operator=STRA&max_results=10

I had a look into pathnames.h and the Makefile. At the moment I
suspect the following cpp macros plus Makefile entries as the source
of the problem:

pathnames.h:

 22 #if (defined(BSD)) && (BSD >= 199103) || defined(__linux__) || defined(AIX)
 23 # include <paths.h>
 24 #endif /*BSD*/

Makefile:

 65 #(BSD is only needed if <sys/params.h> does not define it, as on ULTRIX)
 66 #COMPAT         =       -DBSD

For testing I compiled cron just with main() replaced by a routine
which just outputs the values of the cpp macros BSD, DEBIAN and
_PATH_VARRUN:

---snip---
#include <stdio.h>   

#ifndef BSD
#define BSD ""
#endif

#ifndef DEBIAN
#define DEBIAN ""
#endif

#ifndef _PATH_VARRUN
#define _PATH_VARRUN ""
#endif

int main (void) {
    printf("bsd=%s\n", BSD);
    printf("path_varrun=%s\n", _PATH_VARRUN);
    printf("debian=%s\n", DEBIAN);
    return 0;
}
---snap---

What I get is: 

bsd=
path_varrun=
debian=

With an additional "#include <paths.h>", I get the following output:

bsd=
path_varrun=/var/run/
debian=

which seems fine.

If I do include an "#include <sys/param.h>" _instead_, I again get 

bsd=
path_varrun=
debian=

And an

egrep '# *define +BSD' /usr/include/sys/*.h

doesn't find anything.

So <sys/param.h> does not define BSD ob GNU/kFreeBSD (which is
reasonable since it's no BSD userland and no BSD libc) but it also
defines neither __linux__ nor AIX and therefore /usr/include/paths.h
is not included at all -- so that's probably the reason why cron
doesn't know about /var/run.

Following is a patch which fixes this issue:

diff -U3 -r cron-3.0pl1-101/Makefile cron-3.0pl1/Makefile
--- cron-3.0pl1-101/Makefile    2008-01-13 20:46:16.000000000 +0100
+++ cron-3.0pl1/Makefile        2008-01-13 21:18:52.000000000 +0100
@@ -65,7 +65,7 @@
 #(BSD is only needed if <sys/params.h> does not define it, as on ULTRIX)
 #COMPAT                =       -DBSD
 # (POSIX)
-COMPAT         =       -DPOSIX
+COMPAT         =       -DPOSIX $(shell test "`uname -o`" = "GNU/kFreeBSD" && 
echo -n -DGNUKFREEBSD)
 #<<lint flags of choice?>>
 LINTFLAGS      =       -hbxa $(INCLUDE) $(COMPAT) $(DEBUGGING)
 #<<want to use a nonstandard CC?>>
diff -U3 -r cron-3.0pl1-101/pathnames.h cron-3.0pl1/pathnames.h
--- cron-3.0pl1-101/pathnames.h 2008-01-13 20:46:16.000000000 +0100
+++ cron-3.0pl1/pathnames.h     2008-01-13 21:19:19.000000000 +0100
@@ -19,7 +19,7 @@
  * $Id: pathnames.h,v 1.3 1994/01/15 20:43:43 vixie Exp $
  */
 
-#if (defined(BSD)) && (BSD >= 199103) || defined(__linux__) || defined(AIX)
+#if (defined(BSD)) && (BSD >= 199103) || defined(__linux__) || defined(AIX) || 
defined(GNUKFREEBSD)
 # include <paths.h>
 #endif /*BSD*/
 
I have successfully tested it on kfreebsd-amd64, but not oon
non-kfreebsd architectures.

HTH.

        Regards from the just finished BSP in Zurich, Axel
-- 
Axel Beckert - [EMAIL PROTECTED], [EMAIL PROTECTED] - http://noone.org/abe/


Reply via email to