浏览代码

create pid before load config file to avoid systemd complain

Nick Peng 6 年之前
父节点
当前提交
408c199564
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/smartdns.c

+ 3 - 3
src/smartdns.c

@@ -416,12 +416,12 @@ int main(int argc, char *argv[])
 		_reg_signal();
 		_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;
 		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;
 		goto errout;
 	}
 	}