Delay the call to check_limits() until after daemonization so that the
message goes to the server log and is not printed to some other output
location.
if (getuid() == 0)
fatal("PgBouncer should not run as root");
- /* need to do that after loading config */
- check_limits();
-
admin_setup();
if (cf_reboot) {
if (cf_daemon)
go_daemon();
+ /* need to do that after loading config; also do after
+ * go_daemon() so that output goes to log file */
+ check_limits();
+
/* initialize subsystems, order important */
srandom(time(NULL) ^ getpid());
if (!event_init())