571:468377312726 | 572:7a03181d29a3 |
---|---|
30 #include "nodes.h" | 30 #include "nodes.h" |
31 | 31 |
32 | 32 |
33 int my_shutdown = FALSE; | 33 int my_shutdown = FALSE; |
34 int debug = FALSE; | 34 int debug = FALSE; |
35 static pid_t pgrp, mypid; | 35 static pid_t /*pgrp, */mypid; |
36 char *Private_Path = NULL; /* Users data path */ | 36 char *Private_Path = NULL; /* Users data path */ |
37 | 37 |
38 extern sys_config Config; | 38 extern sys_config Config; |
39 | 39 |
40 | 40 |
131 if (debug) | 131 if (debug) |
132 fprintf(stdout, "[main] Entering main loop\n"); | 132 fprintf(stdout, "[main] Entering main loop\n"); |
133 | 133 |
134 while (my_shutdown == FALSE) { | 134 while (my_shutdown == FALSE) { |
135 | 135 |
136 usleep(100000); | 136 usleep(1000000); |
137 nodes_check_online(); | 137 nodes_check_online(); |
138 } | 138 } |
139 if (debug) | 139 if (debug) |
140 fprintf(stdout, "[main] Exit from main loop\n"); | 140 fprintf(stdout, "[main] Exit from main loop\n"); |
141 | 141 |
215 * users control terminal. This is done before the fork, so | 215 * users control terminal. This is done before the fork, so |
216 * that the child will not be a process group leader. Otherwise, | 216 * that the child will not be a process group leader. Otherwise, |
217 * if the child were to open a terminal, it would become | 217 * if the child were to open a terminal, it would become |
218 * associated with that terminal as its control terminal. | 218 * associated with that terminal as its control terminal. |
219 */ | 219 */ |
220 if ((pgrp = setpgid(0, 0)) == -1) { | 220 // if ((pgrp = setpgid(0, 0)) == -1) { |
221 syslog(LOG_NOTICE, "setpgpid failed"); | 221 // syslog(LOG_NOTICE, "setpgid failed: %s", strerror(errno)); |
222 } | 222 // } |
223 | 223 |
224 frk = fork(); | 224 frk = fork(); |
225 switch (frk) { | 225 switch (frk) { |
226 case -1: | 226 case -1: |
227 syslog(LOG_NOTICE, "Daemon fork failed: %s", strerror(errno)); | 227 syslog(LOG_NOTICE, "Daemon fork failed: %s", strerror(errno)); |