From 408c19956489403c0baf9b155f6fcffe402de463 Mon Sep 17 00:00:00 2001 From: Nick Peng Date: Wed, 6 Nov 2019 23:58:27 +0800 Subject: [PATCH] create pid before load config file to avoid systemd complain --- src/smartdns.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/smartdns.c b/src/smartdns.c index 7b06532..31fb1bf 100644 --- a/src/smartdns.c +++ b/src/smartdns.c @@ -416,12 +416,12 @@ int main(int argc, char *argv[]) _reg_signal(); } - if (dns_server_load_conf(config_file) != 0) { - fprintf(stderr, "load config failed.\n"); + if (create_pid_file(pid_file) != 0) { goto errout; } - if (create_pid_file(pid_file) != 0) { + if (dns_server_load_conf(config_file) != 0) { + fprintf(stderr, "load config failed.\n"); goto errout; }