From 49e2e9cf1e8551591ed92de0b971c8780b6c313c Mon Sep 17 00:00:00 2001 From: florian Date: Fri, 18 Oct 2013 14:47:47 +0000 Subject: Logging to syslog works better with openlog(3). OK blambert --- slowcgi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/slowcgi.c b/slowcgi.c index 73de8d7..9540897 100644 --- a/slowcgi.c +++ b/slowcgi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: slowcgi.c,v 1.15 2013/10/18 14:46:47 florian Exp $ */ +/* $OpenBSD: slowcgi.c,v 1.16 2013/10/18 14:47:47 florian Exp $ */ /* * Copyright (c) 2013 David Gwynne * Copyright (c) 2013 Florian Obser @@ -241,6 +241,7 @@ char *fcgi_socket = "/var/www/run/slowcgi.sock"; int main(int argc, char *argv[]) { + extern char *__progname; struct passwd *pw; int c; @@ -268,6 +269,11 @@ main(int argc, char *argv[]) if (!debug && daemon(1, 0) == -1) err(1, "daemon"); + if (!debug) { + openlog(__progname, LOG_PID|LOG_NDELAY, LOG_DAEMON); + logger = &syslogger; + } + event_init(); slowcgi_listen(fcgi_socket, pw->pw_gid); -- cgit v1.2.3-2-gb3c3