C fork not exiting -
I am quite new to C and I have given the code below for some shell scripts (nsdc.sh) every 10 Written in seconds. For some reason this shell script is calling multiple times (in a loop) It seems that Thanks advance! Therefore, after the general deduction and reliance on all aspects of your description, the only possible way of execution May be, which leads to your outcome: Your "nsdc.sh" script never goes out. Right? _exit is not being called, can anyone explain this behavior to me?
#include "dynzone.h" void dynzone_run (struct nsd * nsd) {while (1) {pid_t pid = fork (); If (pid == -1) {log_msg (LOG_ERR, "Fork zone failed to reload"); } And if (pid == 0) {/ * CHILD * / log_msg (LOG_NOTICE, "exec reload"); If (system ("/ home / edns / jarno / v1 / nsdc.sh reload") == -1) {printf ("reload error:% s \ n", strerror (errno)); } _ext (1); } Sleep (10); }} Void dynzone_spawn (struct nsd * nsd) {pid_t pid; Pid = fork (); If (pid == -1) {log_msg (LOG_ERR, "fork dygen failed"); } And if (pd == 0) {/ * CHILD * / log_msg (LOG_NOTICE, "spanned dyonjon"); Dynzone_run (NSD); / * ENOTREACH * / Exit (0); } / * Parent * / return; }
Comments
Post a Comment