diff -dru dcron/Makefile dcron.fjo/Makefile --- dcron/Makefile Tue Dec 17 21:08:49 2002 +++ dcron.fjo/Makefile Tue Oct 28 15:29:20 2003 @@ -10,39 +10,53 @@ D_OBJS = crontab.o subs.o PROTOS= protos.h DISTTAR= /home/httpd/htdocs/FreeSrc/dcron29.tgz +STRIP=strip +DESTDIR= +BINDIR=/usr/bin +SBINDIR=/usr/bin +MANDIR=/usr/man +CRONTAB_OWNER=root.cron +CROND_OWNER=root.wheel +CRONTAB_PERM=4750 +CROND_PERM=0700 + +.PHONY: all clean cleano install tar all: ${PROTOS} crond crontab -crond: ${OBJS} +crond: ${OBJS} ${PROTOS} ${CC} ${CFLAGS} -o crond ${OBJS} ${LIB} - strip crond + $(STRIP) crond -crontab: ${D_OBJS} +crontab: ${D_OBJS} ${PROTOS} ${CC} ${CFLAGS} -o crontab ${D_OBJS} - strip crontab + $(STRIP) crontab protos.h: ${SRCS} ${D_SRCS} fgrep -h Prototype ${SRCS} ${D_SRCS} >protos.h +$(OBJS): $(SRCS) defs.h +$(D_OBJS): $(D_SRCS) defs.h + clean: cleano rm -f crond crontab cleano: rm -f *.o dcron.tgz $(PROTOS) -install: - rm -f /usr/bin/crond /usr/bin/crontab - cp crond crontab /usr/bin - chown root.wheel /usr/bin/crond - chown root.cron /usr/bin/crontab - chmod 700 /usr/bin/crond - chmod 4750 /usr/bin/crontab - -mkdirs /usr/man/man1 - -mkdirs /usr/man/man8 - cp crontab.1 /usr/man/man1 - cp crond.8 /usr/man/man8 - chmod 444 /usr/man/man1/crontab.1 - chmod 444 /usr/man/man8/crond.8 +install: crontab crond + mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(SBINDIR) \ + $(DESTDIR)$(MANDIR)/man1 $(DESTDIR)$(MANDIR)/man8 + cp crontab $(DESTDIR)$(BINDIR) + cp crond $(DESTDIR)$(SBINDIR) + chown $(CRONTAB_OWNER) $(DESTDIR)$(BINDIR)/crontab + chown $(CROND_OWNER) $(DESTDIR)$(SBINDIR)/crond + chmod $(CRONTAB_PERM) $(DESTDIR)$(BINDIR)/crontab + chmod $(CROND_PERM) $(DESTDIR)$(SBINDIR)/crond + cp crontab.1 $(DESTDIR)$(MANDIR)/man1 + cp crond.8 $(DESTDIR)$(MANDIR)/man8 + chmod 444 $(DESTDIR)$(MANDIR)/man1/crontab.1 + chmod 444 $(DESTDIR)$(MANDIR)/man8/crond.8 # dillon-specific # diff -dru dcron/defs.h dcron.fjo/defs.h --- dcron/defs.h Tue Dec 17 21:06:51 2002 +++ dcron.fjo/defs.h Tue Oct 28 15:28:35 2003 @@ -49,6 +49,9 @@ #ifndef PATH_VI #define PATH_VI "/usr/bin/vi" /* location of vi */ #endif +#ifndef PIDFILE +#define PIDFILE "/var/run/crond.pid" +#endif #define VERSION "V2.9" diff -dru dcron/job.c dcron.fjo/job.c --- dcron/job.c Tue Dec 17 21:05:35 2002 +++ dcron.fjo/job.c Tue Oct 28 15:28:35 2003 @@ -213,9 +213,8 @@ /* * note: 8 is a file descriptor */ - logfd(8, "unable to exec %s %s, user %s, output to sink null", + logfd(8, "unable to exec %s, user %s, output to sink null", SENDMAIL, - SENDMAIL_ARGS, file->cf_User ); exit(0); diff -dru dcron/main.c dcron.fjo/main.c --- dcron/main.c Tue Dec 17 21:05:44 2002 +++ dcron.fjo/main.c Tue Oct 28 15:28:35 2003 @@ -124,6 +124,12 @@ } if (pid > 0) exit(0); + + if ((fd = open(PIDFILE, O_WRONLY | O_CREAT | O_TRUNC, + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP)) >= 0) { + fdprintf(fd, "%i", getpid()); + close(fd); + } } /*