daemon: send more error messages to the syslog
There were a number of die() calls before the syslog was opened; hence, these error messages would have been sent to /dev/null in detached mode. Now we install the daemon-specific die routine before any error message is generated so that these messages go to the syslog. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Sixt committed
Feb 25, 2008 at 14:25 UTC
22665bbaab799b1f20a23039a5c759cd35d36939
1 file changed
+5
-5
daemon.c
+5
-5
@@ -1149,6 +1149,11 @@ int main(int argc, char **argv)
1149
usage(daemon_usage);
1150
}
1151
1152
+ if (log_syslog) {
1153
+ openlog("git-daemon", 0, LOG_DAEMON);
1154
+ set_die_routine(daemon_die);
1155
+ }
1156
+
1157
if (inetd_mode && (group_name || user_name))
1158
die("--user and --group are incompatible with --inetd");
1159
@@ -1176,11 +1181,6 @@ int main(int argc, char **argv)
1181
}
1182
}
1183
1179
- if (log_syslog) {
1180
- openlog("git-daemon", 0, LOG_DAEMON);
1181
- set_die_routine(daemon_die);
1182
- }
1183
-
1184
if (strict_paths && (!ok_paths || !*ok_paths))
1185
die("option --strict-paths requires a whitelist");
1186