aboutsummaryrefslogtreecommitdiff
path: root/src/cmdline.opt
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-02-24 00:49:40 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2009-02-24 00:57:16 +0200
commit4213ec5ef9695aa504938c0e764ba9a4f08921b2 (patch)
tree88ac2b2eb01337f0924d687df38b2a163bc94e11 /src/cmdline.opt
parent337a06f32fb530e0e0884fef2f5f630cca9911a1 (diff)
downloadwydawca-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.opt48
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
@@ -18,6 +18,7 @@ static struct obstack pp_cmd_stack;
18static int pp_cmd_stack_init; 18static int pp_cmd_stack_init;
19 19
20static gl_list_t source_list; 20static gl_list_t source_list;
21static gl_list_t tag_list;
21 22
22static bool 23static bool
23source_eq (const void *elt1, const void *elt2) 24source_eq (const void *elt1, const void *elt2)
@@ -28,9 +29,10 @@ source_eq (const void *elt1, const void *elt2)
28int 29int
29enabled_spool_p (const struct spool *spool) 30enabled_spool_p (const struct spool *spool)
30{ 31{
31 if (!source_list) 32 if (source_list || tag_list)
32 return 1; 33 return (source_list && gl_list_search (source_list, spool->source_dir))
33 return !!gl_list_search (source_list, spool->source_dir); 34 || (tag_list && gl_list_search (tag_list, spool->tag));
35 return 1;
34} 36}
35 37
36OPTIONS_BEGIN(gnu, "wydawca", 38OPTIONS_BEGIN(gnu, "wydawca",
@@ -61,12 +63,47 @@ BEGIN
61 dry_run_mode = 1; 63 dry_run_mode = 1;
62END 64END
63 65
66OPTION(cron,,,
67 [<force cron mode>])
68BEGIN
69 cron_option = 1;
70 log_to_stderr = 0;
71END
72
73OPTION(force,,,
74 [<force start up even if the pid file already exists>])
75BEGIN
76 force_startup = 1;
77END
78
79OPTION(foreground,,,
80 [<foreground mode>])
81BEGIN
82 foreground_option = 1;
83END
84
85OPTION(single-process,,,
86 [<single process mode>])
87BEGIN
88 single_process_option = 1;
89END
90
64OPTION(config-file,c,FILE, 91OPTION(config-file,c,FILE,
65 [<use FILE instead of the default configuration>]) 92 [<use FILE instead of the default configuration>])
66BEGIN 93BEGIN
67 conffile = optarg; 94 conffile = optarg;
68END 95END
69 96
97OPTION(spool,S,TAG,
98 [<process only spool with the given tag>])
99BEGIN
100 if (!tag_list)
101 tag_list = gl_list_create_empty (&gl_linked_list_implementation,
102 source_eq, NULL,
103 NULL, false);
104 gl_list_add_last (tag_list, optarg);
105END
106
70OPTION(source,s,SOURCE-DIR, 107OPTION(source,s,SOURCE-DIR,
71 [<process only spool with the given source (may be used multiple times)>]) 108 [<process only spool with the given source (may be used multiple times)>])
72BEGIN 109BEGIN
@@ -79,9 +116,8 @@ END
79 116
80GROUP(Logging) 117GROUP(Logging)
81 118
82OPTION(cron,,, 119OPTION(syslog,,,
83 [<log to syslog>]) 120 [<log to syslog>])
84ALIAS(syslog)
85BEGIN 121BEGIN
86 log_to_stderr = 0; 122 log_to_stderr = 0;
87END 123END

Return to:

Send suggestions and report system problems to the System administrator.