summaryrefslogtreecommitdiff
path: root/pullreqd.c
diff options
context:
space:
mode:
Diffstat (limited to 'pullreqd.c')
-rw-r--r--pullreqd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/pullreqd.c b/pullreqd.c
index c2635a3..ae98078 100644
--- a/pullreqd.c
+++ b/pullreqd.c
@@ -63,9 +63,6 @@ void init_daemon(int change_dir, char *path) {
/* Close any open file descriptors. */
for (int i = sysconf(_SC_OPEN_MAX); i >= 0; close(i--));
-
- /* Open the logfile. */
- openlog("pullreqd", LOG_PID, LOG_DAEMON);
}
int init_config(char *config_file, config **cfg) {
@@ -199,7 +196,12 @@ int main(int argc, char **argv) {
int listen_socket = -1;
int exit_status = EXIT_FAILURE;
+ /* Start it in daemon mode. */
init_daemon(1, "/");
+
+ /* Open the logfile. */
+ openlog("pullreqd", LOG_PID, LOG_DAEMON);
+
log(LOG_NOTICE, "pullreqd started.");
/* Read the config file. */