Hi I need to restart a running C process from Linux prompt. I googled it and some sites suggested SIGHUP which is not working in my case. Any other suggestions/pointers?
I have following code snippet
#include <stdio.h>
#include <unistd.h>
int main() {
fprintf(stderr,"%s","Entering main function\n");
while(1) {
sleep (1);
}
fprintf(stderr,"%s","Exiting main function\n");
return;
}
Linux output
#] ./simple &
[1] 489440
#] Entering main function
#] ps aux | grep simple
user 489440 0.0 0.0 3924 360 pts/135 S 13:25 0:00 ./simple
user 489710 0.0 0.0 105312 804 pts/135 S+ 13:25 0:00 grep simple
#] kill -1 489440
[1] Hangup ./simple
#] ps aux | grep simple
user 490181 0.0 0.0 105312 800 pts/135 S+ 13:25 0:00 grep simple
#]