| 47 |
|
|
| 48 |
|
static struct sigaction ALARMACTION; |
| 49 |
|
static struct sigaction INTACTION; |
| 50 |
+ |
static struct sigaction HUPACTION; |
| 51 |
|
static struct sigaction USR1ACTION; |
| 52 |
|
|
| 53 |
|
static const char *CONFNAME = DEFAULTNAME; |
| 71 |
|
log_printf("MAIN -> Caught SIGINT, bye!"); |
| 72 |
|
exit(0); |
| 73 |
|
break; |
| 74 |
+ |
case SIGHUP: |
| 75 |
+ |
RESTART = 1; |
| 76 |
+ |
break; |
| 77 |
|
case SIGUSR1: |
| 78 |
|
REOPEN = 1; |
| 79 |
|
break; |
| 180 |
|
ALARMACTION.sa_handler = &do_signal; |
| 181 |
|
ALARMACTION.sa_flags = SA_RESTART; |
| 182 |
|
INTACTION.sa_handler = &do_signal; |
| 183 |
+ |
HUPACTION.sa_handler = &do_signal; |
| 184 |
|
USR1ACTION.sa_handler = &do_signal; |
| 185 |
|
|
| 186 |
|
sigaction(SIGALRM, &ALARMACTION, 0); |
| 187 |
|
sigaction(SIGINT, &INTACTION, 0); |
| 188 |
+ |
sigaction(SIGHUP, &HUPACTION, 0); |
| 189 |
|
sigaction(SIGUSR1, &USR1ACTION, 0); |
| 190 |
|
|
| 191 |
|
/* Ignore SIGPIPE. */ |
| 220 |
|
fcntl(i, F_SETFD, FD_CLOEXEC); |
| 221 |
|
|
| 222 |
|
/* execute new process */ |
| 223 |
< |
if (execv(argv[0], argv) == -1) |
| 224 |
< |
log_printf("MAIN RESTART -> Execution of \"%s\" failed. ERROR: %s", argv[0], strerror(errno)); |
| 223 |
> |
if (execv(HOPM_BINPATH, argv) == -1) |
| 224 |
> |
log_printf("MAIN RESTART -> Execution of \"%s\" failed. ERROR: %s", HOPM_BINPATH, strerror(errno)); |
| 225 |
|
|
| 226 |
|
exit(0); /* Should only get here if execv() failed */ |
| 227 |
|
} |