Now runs (only) against guile-2.0.
This commit is contained in:
parent
bd5a58ac2f
commit
c45e7c447b
12 changed files with 112 additions and 163 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -3,6 +3,7 @@
|
||||||
INSTALL
|
INSTALL
|
||||||
aclocal.m4
|
aclocal.m4
|
||||||
autom4te.cache
|
autom4te.cache
|
||||||
|
compile
|
||||||
config.log
|
config.log
|
||||||
config.scm
|
config.scm
|
||||||
config.status
|
config.status
|
||||||
|
|
@ -15,7 +16,7 @@ makefile.in
|
||||||
mcron
|
mcron
|
||||||
mcron.c
|
mcron.c
|
||||||
mcron.info
|
mcron.info
|
||||||
mcron.o
|
*.o
|
||||||
mcron.texinfo
|
mcron.texinfo
|
||||||
missing
|
missing
|
||||||
texinfo.tex
|
texinfo.tex
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
2014-04-28 Dale Mellor <dale_mellor@users.sourceforge.net>
|
||||||
|
|
||||||
|
* We now run against, and require, guile-2.0.
|
||||||
|
|
||||||
|
|
||||||
2012-02-04 Dale Mellor <dale_mellor@users.sourceforge.net>
|
2012-02-04 Dale Mellor <dale_mellor@users.sourceforge.net>
|
||||||
|
|
||||||
* main.scm: added search for initial files in
|
* main.scm: added search for initial files in
|
||||||
|
|
|
||||||
4
README
4
README
|
|
@ -1,13 +1,13 @@
|
||||||
GNU mcron --- README -*-text-*-
|
GNU mcron --- README -*-text-*-
|
||||||
|
|
||||||
Copyright (C) 2003, 2005, 2006, 2012 Dale Mellor
|
Copyright (C) 2003, 2005, 2006, 2012, 2014 Dale Mellor
|
||||||
|
|
||||||
Copying and distribution of this file, with or without modification,
|
Copying and distribution of this file, with or without modification,
|
||||||
are permitted in any medium without royalty provided the copyright
|
are permitted in any medium without royalty provided the copyright
|
||||||
notice and this notice are preserved.
|
notice and this notice are preserved.
|
||||||
|
|
||||||
|
|
||||||
This is version 1.0.7 of the GNU mcron program. It is designed and written by
|
This is version 1.0.8 of the GNU mcron program. It is designed and written by
|
||||||
Dale Mellor, and replaces and hugely enhances Vixie cron. It is functionally
|
Dale Mellor, and replaces and hugely enhances Vixie cron. It is functionally
|
||||||
complete, production quality code (did you expect less?), but has not received
|
complete, production quality code (did you expect less?), but has not received
|
||||||
much testing yet. It has only been built on a GNU/Linux system, and will most
|
much testing yet. It has only been built on a GNU/Linux system, and will most
|
||||||
|
|
|
||||||
12
README--git
12
README--git
|
|
@ -1,6 +1,6 @@
|
||||||
GNU mcron --- README--git -*-text-*-
|
GNU mcron --- README--git -*-text-*-
|
||||||
|
|
||||||
Copyright (C) 2012 Dale Mellor
|
Copyright (C) 2012, 2014 Dale Mellor
|
||||||
|
|
||||||
Copying and distribution of this file, with or without modification,
|
Copying and distribution of this file, with or without modification,
|
||||||
are permitted in any medium without royalty provided the copyright
|
are permitted in any medium without royalty provided the copyright
|
||||||
|
|
@ -10,11 +10,11 @@ GNU mcron --- README--git -*-text-*-
|
||||||
If you have pulled mcron from the GIT repository, these are the steps you will
|
If you have pulled mcron from the GIT repository, these are the steps you will
|
||||||
need to take to build it the first time:
|
need to take to build it the first time:
|
||||||
|
|
||||||
1) cp mcron.texinfo.in mcron.texinfo
|
1) aclocal
|
||||||
2) aclocal
|
2) autoconf
|
||||||
4) autoconf
|
3) automake -a (will error)
|
||||||
3) automake -a
|
4) ./configure (will error)
|
||||||
5) rm mcron.texinfo
|
5) automake -a
|
||||||
6) ./configure --prefix={wherever}
|
6) ./configure --prefix={wherever}
|
||||||
7) make install
|
7) make install
|
||||||
|
|
||||||
|
|
|
||||||
4
TODO
4
TODO
|
|
@ -1,6 +1,6 @@
|
||||||
GNU mcron --- TODO -*-text-*-
|
GNU mcron --- TODO -*-text-*-
|
||||||
|
|
||||||
Copyright (C) 2003, 2005, 2006 Dale Mellor
|
Copyright (C) 2003, 2005, 2006, 2014 Dale Mellor
|
||||||
|
|
||||||
Copying and distribution of this file, with or without modification,
|
Copying and distribution of this file, with or without modification,
|
||||||
are permitted in any medium without royalty provided the copyright
|
are permitted in any medium without royalty provided the copyright
|
||||||
|
|
@ -45,4 +45,4 @@ May happen if version 2.0 ever materializes...
|
||||||
* TCP socket to allow control via HTTP (web browser interface). Or maybe
|
* TCP socket to allow control via HTTP (web browser interface). Or maybe
|
||||||
crontab-like CGI personality.
|
crontab-like CGI personality.
|
||||||
|
|
||||||
* GTK+/Bononbo/Gnome2 interface.
|
* GTK+/d-bus/Gnome3 interface.
|
||||||
|
|
|
||||||
21
configure.ac
21
configure.ac
|
|
@ -2,7 +2,7 @@
|
||||||
# Process this file with autoconf to produce a configure script.
|
# Process this file with autoconf to produce a configure script.
|
||||||
|
|
||||||
|
|
||||||
# Copyright (C) 2003, 2005, 2012 Dale Mellor
|
# Copyright (C) 2003, 2005, 2012, 2014 Dale Mellor
|
||||||
#
|
#
|
||||||
# This file is part of GNU mcron.
|
# This file is part of GNU mcron.
|
||||||
#
|
#
|
||||||
|
|
@ -42,11 +42,9 @@ AC_SUBST(CONFIG_DEBUG)
|
||||||
|
|
||||||
AC_PROG_AWK
|
AC_PROG_AWK
|
||||||
AC_PROG_EGREP
|
AC_PROG_EGREP
|
||||||
AC_PROG_CC
|
AM_PROG_CC_C_O
|
||||||
GUILE_PROGS
|
|
||||||
GUILE_FLAGS
|
|
||||||
GUILE_SITE_DIR
|
|
||||||
|
|
||||||
|
PKG_CHECK_MODULES(GUILE, guile-2.0 >= 2.0.7)
|
||||||
|
|
||||||
# Checks for programs.
|
# Checks for programs.
|
||||||
|
|
||||||
|
|
@ -72,17 +70,6 @@ if test "x$ac_cv_prog_CP" = "x"; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Check the Guile version.
|
|
||||||
|
|
||||||
AC_MSG_CHECKING(for guile version >= 1.8.0)
|
|
||||||
if [$GUILE --version | $HEAD -1 | $AWK '{print $2}' | \
|
|
||||||
$EGREP -q '^1\.8\.']; then
|
|
||||||
AC_MSG_RESULT(OK)
|
|
||||||
else
|
|
||||||
AC_MSG_ERROR([Sorry, Guile 1.8.0 or greater is needed to run mcron])
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Now find a sendmail or equivalent.
|
# Now find a sendmail or equivalent.
|
||||||
|
|
||||||
AC_CHECK_PROGS(SENDMAIL, sendmail)
|
AC_CHECK_PROGS(SENDMAIL, sendmail)
|
||||||
|
|
@ -182,5 +169,5 @@ real_program_prefix=`echo $program_prefix | sed s/NONE//`
|
||||||
AC_SUBST(real_program_prefix)
|
AC_SUBST(real_program_prefix)
|
||||||
|
|
||||||
|
|
||||||
AC_CONFIG_FILES(makefile config.scm mcron.texinfo)
|
AC_CONFIG_FILES(mcron.texinfo makefile config.scm)
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
|
||||||
54
crontab.scm
54
crontab.scm
|
|
@ -1,4 +1,4 @@
|
||||||
;; Copyright (C) 2003 Dale Mellor
|
;; Copyright (C) 2003, 2014 Dale Mellor
|
||||||
;;
|
;;
|
||||||
;; This file is part of GNU mcron.
|
;; This file is part of GNU mcron.
|
||||||
;;
|
;;
|
||||||
|
|
@ -27,14 +27,15 @@
|
||||||
;; Procedure to communicate with running cron daemon that a user has modified
|
;; Procedure to communicate with running cron daemon that a user has modified
|
||||||
;; his crontab. The user name is written to the /var/cron/socket UNIX socket.
|
;; his crontab. The user name is written to the /var/cron/socket UNIX socket.
|
||||||
|
|
||||||
(define (hit-server user-name)
|
(let ((hit-server
|
||||||
|
(lambda (user-name)
|
||||||
(catch #t (lambda ()
|
(catch #t (lambda ()
|
||||||
(let ((socket (socket AF_UNIX SOCK_STREAM 0)))
|
(let ((socket (socket AF_UNIX SOCK_STREAM 0)))
|
||||||
(connect socket AF_UNIX config-socket-file)
|
(connect socket AF_UNIX config-socket-file)
|
||||||
(display user-name socket)
|
(display user-name socket)
|
||||||
(close socket)))
|
(close socket)))
|
||||||
(lambda (key . args)
|
(lambda (key . args)
|
||||||
(display "Warning: a cron daemon is not running.\n"))))
|
(display "Warning: a cron daemon is not running.\n")))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -42,23 +43,26 @@
|
||||||
;; /var/cron/allow and /var/cron/deny), and determine if the given name is in
|
;; /var/cron/allow and /var/cron/deny), and determine if the given name is in
|
||||||
;; there. The procedure returns #t, #f, or '() if the file does not exist.
|
;; there. The procedure returns #t, #f, or '() if the file does not exist.
|
||||||
|
|
||||||
(define (in-access-file? file name)
|
(in-access-file?
|
||||||
|
(lambda (file name)
|
||||||
(catch #t (lambda ()
|
(catch #t (lambda ()
|
||||||
(with-input-from-file file (lambda ()
|
(with-input-from-file
|
||||||
|
file
|
||||||
|
(lambda ()
|
||||||
(let loop ((input (read-line)))
|
(let loop ((input (read-line)))
|
||||||
(if (eof-object? input)
|
(if (eof-object? input)
|
||||||
#f
|
#f
|
||||||
(if (string=? input name)
|
(if (string=? input name)
|
||||||
#t
|
#t
|
||||||
(loop (read-line))))))))
|
(loop (read-line))))))))
|
||||||
(lambda (key . args) '())))
|
(lambda (key . args) '()))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; This program should have been installed SUID root. Here we get the passwd
|
;; This program should have been installed SUID root. Here we get the
|
||||||
;; entry for the real user who is running this program.
|
;; passwd entry for the real user who is running this program.
|
||||||
|
|
||||||
(define crontab-real-user (passwd:name (getpw (getuid))))
|
(crontab-real-user (passwd:name (getpw (getuid)))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -71,7 +75,8 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; Check that no more than one of the mutually exclusive options are being used.
|
;; Check that no more than one of the mutually exclusive options are being
|
||||||
|
;; used.
|
||||||
|
|
||||||
(if (> (+ (if (option-ref options 'edit #f) 1 0)
|
(if (> (+ (if (option-ref options 'edit #f) 1 0)
|
||||||
(if (option-ref options 'list #f) 1 0)
|
(if (option-ref options 'list #f) 1 0)
|
||||||
|
|
@ -89,24 +94,26 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; Iff the --user option is given, the crontab-user may be different from the
|
(let (
|
||||||
;; real user.
|
|
||||||
|
|
||||||
(define crontab-user (option-ref options 'user crontab-real-user))
|
|
||||||
|
|
||||||
|
;; Iff the --user option is given, the crontab-user may be different
|
||||||
|
;; from the real user.
|
||||||
|
|
||||||
|
(crontab-user (option-ref options 'user crontab-real-user))
|
||||||
|
|
||||||
|
|
||||||
;; So now we know which crontab file we will be manipulating.
|
;; So now we know which crontab file we will be manipulating.
|
||||||
|
|
||||||
(define crontab-file (string-append config-spool-dir "/" crontab-user))
|
(crontab-file (string-append config-spool-dir "/" crontab-user))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; Display the prompt and wait for user to type his choice. Return #t if the
|
;; Display the prompt and wait for user to type his choice. Return #t if
|
||||||
;; answer begins with 'y' or 'Y', return #f if it begins with 'n' or 'N',
|
;; the answer begins with 'y' or 'Y', return #f if it begins with 'n' or
|
||||||
;; otherwise ask again.
|
;; 'N', otherwise ask again.
|
||||||
|
|
||||||
(define (get-yes-no prompt . re-prompt)
|
(get-yes-no (lambda (prompt . re-prompt)
|
||||||
(if (not (null? re-prompt))
|
(if (not (null? re-prompt))
|
||||||
(display "Please answer y or n.\n"))
|
(display "Please answer y or n.\n"))
|
||||||
(display (string-append prompt " "))
|
(display (string-append prompt " "))
|
||||||
|
|
@ -116,13 +123,13 @@
|
||||||
((#\y #\Y) #t)
|
((#\y #\Y) #t)
|
||||||
((#\n #\N) #f)
|
((#\n #\N) #f)
|
||||||
(else (get-yes-no prompt #t)))
|
(else (get-yes-no prompt #t)))
|
||||||
(get-yes-no prompt #t))))
|
(get-yes-no prompt #t))))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; There are four possible sub-personalities to the crontab personality: list,
|
;; There are four possible sub-personalities to the crontab personality:
|
||||||
;; remove, edit and replace (when the user uses no options but supplies file
|
;; list, remove, edit and replace (when the user uses no options but
|
||||||
;; names on the command line).
|
;; supplies file names on the command line).
|
||||||
|
|
||||||
(cond
|
(cond
|
||||||
|
|
||||||
|
|
@ -216,3 +223,6 @@
|
||||||
|
|
||||||
(else
|
(else
|
||||||
(mcron-error 15 "usage error: file name must be specified for replace.")))
|
(mcron-error 15 "usage error: file name must be specified for replace.")))
|
||||||
|
|
||||||
|
|
||||||
|
)) ;; End of file-level let-scopes.
|
||||||
|
|
|
||||||
2
main.scm
2
main.scm
|
|
@ -131,7 +131,7 @@
|
||||||
" command-name " (" config-package-string ")\n
|
" command-name " (" config-package-string ")\n
|
||||||
Written by Dale Mellor\n
|
Written by Dale Mellor\n
|
||||||
\n
|
\n
|
||||||
Copyright (C) 2003, 2006 Dale Mellor\n
|
Copyright (C) 2003, 2006, 2014 Dale Mellor\n
|
||||||
This is free software; see the source for copying conditions. There is NO\n
|
This is free software; see the source for copying conditions. There is NO\n
|
||||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n
|
||||||
"))
|
"))
|
||||||
|
|
|
||||||
|
|
@ -31,15 +31,14 @@ EXTRA_DIST = makefile.ed main.scm mcron-core.scm vixie-specification.scm \
|
||||||
crontab.scm environment.scm job-specifier.scm redirect.scm \
|
crontab.scm environment.scm job-specifier.scm redirect.scm \
|
||||||
vixie-time.scm mcron.c.template BUGS
|
vixie-time.scm mcron.c.template BUGS
|
||||||
|
|
||||||
AM_LDFLAGS = @GUILE_LDFLAGS@
|
|
||||||
AM_CFLAGS = @GUILE_CFLAGS@ -DGUILE_LOAD_PATH=\"$(datadir)\"
|
|
||||||
|
|
||||||
info_TEXINFOS = mcron.texinfo
|
info_TEXINFOS = mcron.texinfo
|
||||||
|
|
||||||
dist_man1_MANS = mcron.1
|
dist_man1_MANS = mcron.1
|
||||||
|
|
||||||
bin_PROGRAMS = mcron
|
bin_PROGRAMS = mcron
|
||||||
mcron_SOURCES = mcron.c
|
mcron_SOURCES = mcron.c
|
||||||
|
mcron_LDADD = @GUILE_LIBS@
|
||||||
|
mcron_CFLAGS = @GUILE_CFLAGS@ -DGUILE_LOAD_PATH=\"$(datadir)\"
|
||||||
|
|
||||||
pkgdata_DATA = core.scm environment.scm job-specifier.scm redirect.scm \
|
pkgdata_DATA = core.scm environment.scm job-specifier.scm redirect.scm \
|
||||||
vixie-time.scm vixie-specification.scm config.scm
|
vixie-time.scm vixie-specification.scm config.scm
|
||||||
|
|
@ -49,9 +48,6 @@ pkgdata_DATA = core.scm environment.scm job-specifier.scm redirect.scm \
|
||||||
# like core.*, so we have to keep re-making it (I lost a good day's work because
|
# like core.*, so we have to keep re-making it (I lost a good day's work because
|
||||||
# of this).
|
# of this).
|
||||||
|
|
||||||
mcron : mcron.c
|
|
||||||
$(CC) $(AM_CFLAGS) mcron.c -o mcron $(AM_LDFLAGS)
|
|
||||||
|
|
||||||
core.scm : mcron-core.scm
|
core.scm : mcron-core.scm
|
||||||
$(CP) mcron-core.scm core.scm
|
$(CP) mcron-core.scm core.scm
|
||||||
|
|
||||||
|
|
|
||||||
50
mcron.1
50
mcron.1
|
|
@ -1,50 +0,0 @@
|
||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4.
|
|
||||||
.TH MCRON "1" "February 2012" "mcron " "User Commands"
|
|
||||||
.SH NAME
|
|
||||||
mcron \- a program to run tasks at regular (or not) intervals
|
|
||||||
.SH SYNOPSIS
|
|
||||||
.B mcron
|
|
||||||
[\fIOPTIONS\fR] [\fIFILES\fR]
|
|
||||||
.SH DESCRIPTION
|
|
||||||
Run an mcron process according to the specifications in the FILES (`\-' for
|
|
||||||
standard input), or use all the files in ~/.config/cron (or the
|
|
||||||
deprecated ~/.cron) with .guile or .vixie extensions.
|
|
||||||
.TP
|
|
||||||
\fB\-v\fR, \fB\-\-version\fR
|
|
||||||
Display version
|
|
||||||
.TP
|
|
||||||
\fB\-h\fR, \fB\-\-help\fR
|
|
||||||
Display this help message
|
|
||||||
.TP
|
|
||||||
\fB\-sN\fR, \fB\-\-schedule[\fR=\fI]N\fR
|
|
||||||
Display the next N jobs that will be run by mcron
|
|
||||||
.TP
|
|
||||||
\fB\-d\fR, \fB\-\-daemon\fR
|
|
||||||
Immediately detach the program from the terminal
|
|
||||||
and run as a daemon process
|
|
||||||
.TP
|
|
||||||
\fB\-i\fR, \fB\-\-stdin=\fR(guile|vixie) Format of data passed as standard input or
|
|
||||||
file arguments (default guile)
|
|
||||||
.SH AUTHOR
|
|
||||||
Written by Dale Mellor
|
|
||||||
.SH "REPORTING BUGS"
|
|
||||||
Report bugs to dale_mellor@users.sourceforge.net.
|
|
||||||
.PP
|
|
||||||
mcron (mcron 1.0.7)
|
|
||||||
.SH COPYRIGHT
|
|
||||||
Copyright \(co 2003, 2006 Dale Mellor
|
|
||||||
.br
|
|
||||||
This is free software; see the source for copying conditions. There is NO
|
|
||||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
.SH "SEE ALSO"
|
|
||||||
The full documentation for
|
|
||||||
.B mcron
|
|
||||||
is maintained as a Texinfo manual. If the
|
|
||||||
.B info
|
|
||||||
and
|
|
||||||
.B mcron
|
|
||||||
programs are properly installed at your site, the command
|
|
||||||
.IP
|
|
||||||
.B info mcron
|
|
||||||
.PP
|
|
||||||
should give you access to the complete manual.
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/* -*-c-*- */
|
/* -*-c-*- */
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2003 Dale Mellor
|
* Copyright (C) 2003, 2014 Dale Mellor
|
||||||
*
|
*
|
||||||
* This file is part of GNU mcron.
|
* This file is part of GNU mcron.
|
||||||
*
|
*
|
||||||
|
|
@ -66,7 +66,7 @@
|
||||||
void
|
void
|
||||||
react_to_terminal_signal (int sig)
|
react_to_terminal_signal (int sig)
|
||||||
{
|
{
|
||||||
scm_eval_string (scm_take0str ("(delete-run-file)") );
|
scm_c_eval_string ("(delete-run-file)");
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -100,9 +100,9 @@ inner_main ()
|
||||||
{
|
{
|
||||||
scm_c_define_gsubr ("c-set-cron-signals", 0, 0, 0, set_cron_signals);
|
scm_c_define_gsubr ("c-set-cron-signals", 0, 0, 0, set_cron_signals);
|
||||||
|
|
||||||
scm_eval_string (scm_take0str (
|
scm_c_eval_string (
|
||||||
GUILE_PROGRAM_GOES_HERE
|
GUILE_PROGRAM_GOES_HERE
|
||||||
) );
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
@copying This manual is for GNU mcron (version @VERSION@), which is a
|
@copying This manual is for GNU mcron (version @VERSION@), which is a
|
||||||
program for running jobs at scheduled times.
|
program for running jobs at scheduled times.
|
||||||
|
|
||||||
Copyright @copyright{} 2003, 2005, 2006, 2012 Dale Mellor
|
Copyright @copyright{} 2003, 2005, 2006, 2012, 2014 Dale Mellor
|
||||||
|
|
||||||
@quotation
|
@quotation
|
||||||
Permission is granted to copy, distribute and/or modify this
|
Permission is granted to copy, distribute and/or modify this
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue