aboutsummaryrefslogtreecommitdiff
path: root/src/pies.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-10-16 00:05:23 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2009-10-16 01:16:12 +0300
commita0631c9ac2c13c3ef1db027a490620504a287d3f (patch)
tree5cc3c9d5b588974eee29d17c724dbdd8551dfdc8 /src/pies.c
parent9670b8cada0df307c6ffd9be1b14f5dfd51cc958 (diff)
downloadpies-a0631c9ac2c13c3ef1db027a490620504a287d3f.tar.gz
pies-a0631c9ac2c13c3ef1db027a490620504a287d3f.tar.bz2
Various improvements.
* configure.ac (AC_CHECK_FUNCS): Check for vsyslog. * src/diag.c (syslog_printer) [!HAVE_VSYSLOG]: call syslog. * src/pies.c (component_keywords): Remove settle-timeout, replace it with pass-fd-timeout. (main): Force syslog logging if !foreground. Do not close first three fds before restarting if log_to_stderr is set. * src/pies.h (DEFAULT_PASS_FD_TIMEOUT): New constant. (struct component): Replace settle_timeout with pass_fd_timeout. All uses changed. (pass_fd): Pass timeout as argument. * src/progman.c (prog_start): Remove hardcoded sleep before calling pass_fd. Update call to pass_fd. (prog_start_prerequisites): Remove handling of settle_timeout. * src/socket.c (open_unix_socket): Remove. (pass_fd): Rewrite. * doc/pies.texi: Update.
Diffstat (limited to 'src/pies.c')
-rw-r--r--src/pies.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/pies.c b/src/pies.c
index d4a8013..f2ed365 100644
--- a/src/pies.c
+++ b/src/pies.c
@@ -776,11 +776,11 @@ struct grecs_keyword component_keywords[] = {
grecs_type_bool, NULL, offsetof (struct component, disabled),
NULL,
},
- {"settle-timeout",
+ {"pass-fd-timeout",
NULL,
- N_("Time to wait before starting this component."),
+ N_("Time to wait for pass-fd socket to become available."),
grecs_type_uint, NULL,
- offsetof (struct component, settle_timeout),
+ offsetof (struct component, pass_fd_timeout),
NULL,
},
{"precious",
@@ -1856,6 +1856,9 @@ main (int argc, char **argv)
exit (EX_USAGE);
}
+ if (!foreground)
+ log_setup (log_to_stderr = 0);
+
logmsg (LOG_INFO, _("%s starting"), program_version);
if (!foreground)
@@ -1917,9 +1920,10 @@ main (int argc, char **argv)
if (action == ACTION_RESTART && argv[0][0] == '/')
{
+ int minfd = log_to_stderr ? 2 : 0;
int i;
- for (i = getmaxfd (); i > 0; i--)
+ for (i = getmaxfd (); i > minfd; i--)
close (i);
remove_pidfile (pidfile);

Return to:

Send suggestions and report system problems to the System administrator.