diff options
author | florian | 2013-10-18 14:47:47 +0000 |
---|---|---|
committer | Wynn Wolf Arbor | 2020-05-24 12:33:55 +0200 |
commit | 49e2e9cf1e8551591ed92de0b971c8780b6c313c (patch) | |
tree | 7301968e811318d36d21bf489cbbc3437ee0a322 | |
parent | a3ec2ed05314be74abfec31b3991ffd2736bad92 (diff) | |
download | slowcgi-49e2e9cf1e8551591ed92de0b971c8780b6c313c.tar.gz |
Logging to syslog works better with openlog(3). OK blambert
-rw-r--r-- | slowcgi.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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 <dlg@openbsd.org> * Copyright (c) 2013 Florian Obser <florian@openbsd.org> @@ -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); |