diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-02-24 00:49:40 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-02-24 00:57:16 +0200 |
commit | 4213ec5ef9695aa504938c0e764ba9a4f08921b2 (patch) | |
tree | 88ac2b2eb01337f0924d687df38b2a163bc94e11 /src/cmdline.opt | |
parent | 337a06f32fb530e0e0884fef2f5f630cca9911a1 (diff) | |
download | wydawca-4213ec5ef9695aa504938c0e764ba9a4f08921b2.tar.gz wydawca-4213ec5ef9695aa504938c0e764ba9a4f08921b2.tar.bz2 |
Initial implementation of daemon mode.
* gconf/gconf-gram.y (string_to_sockaddr_: Take struct gconf_sockaddr as the
first argument.
* gconf/gconf.h (struct gconf_sockaddr): New data type.
* src/job.c, src/net.c, src/pidfile.c: New files.
* src/Makefile.am (wydawca_SOURCES): Add job.c, net.c, pidfile.c
* src/cmdline.opt: New options: --cron (change semantics), --force,
--foreground, --single-process, --spool
* src/wydawca.c: New daemon mode.
* src/config.c: New statements: spool.alias, daemon, foreground,
single-process, wakeup-interval, pidfile, listen
* src/directive.c, src/diskio.c, src/gpg.c, src/mail.c, src/null.c,
src/process.c, src/triplet.c, src/verify.c, src/vtab.c, src/wydawca.h: use
static struct spool wherever feasible.
* src/triplet.c: New meta-variable "spool"
* tests/etc/wydawca.rcin: Update.
* tests/upload-dry.at: Update.
Diffstat (limited to 'src/cmdline.opt')
-rw-r--r-- | src/cmdline.opt | 48 |
1 files changed, 42 insertions, 6 deletions
diff --git a/src/cmdline.opt b/src/cmdline.opt index 53bdd00..b61517b 100644 --- a/src/cmdline.opt +++ b/src/cmdline.opt @@ -20,2 +20,3 @@ static int pp_cmd_stack_init; static gl_list_t source_list; +static gl_list_t tag_list; @@ -30,5 +31,6 @@ enabled_spool_p (const struct spool *spool) { - if (!source_list) - return 1; - return !!gl_list_search (source_list, spool->source_dir); + if (source_list || tag_list) + return (source_list && gl_list_search (source_list, spool->source_dir)) + || (tag_list && gl_list_search (tag_list, spool->tag)); + return 1; } @@ -63,2 +65,27 @@ END +OPTION(cron,,, + [<force cron mode>]) +BEGIN + cron_option = 1; + log_to_stderr = 0; +END + +OPTION(force,,, + [<force start up even if the pid file already exists>]) +BEGIN + force_startup = 1; +END + +OPTION(foreground,,, + [<foreground mode>]) +BEGIN + foreground_option = 1; +END + +OPTION(single-process,,, + [<single process mode>]) +BEGIN + single_process_option = 1; +END + OPTION(config-file,c,FILE, @@ -69,2 +96,12 @@ END +OPTION(spool,S,TAG, + [<process only spool with the given tag>]) +BEGIN + if (!tag_list) + tag_list = gl_list_create_empty (&gl_linked_list_implementation, + source_eq, NULL, + NULL, false); + gl_list_add_last (tag_list, optarg); +END + OPTION(source,s,SOURCE-DIR, @@ -81,5 +118,4 @@ GROUP(Logging) -OPTION(cron,,, - [<log to syslog>]) -ALIAS(syslog) +OPTION(syslog,,, + [<log to syslog>]) BEGIN |