All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit 2d4e19ea authored by Leigh B Stoller's avatar Leigh B Stoller

Remove pidfile on exit.

parent 7d087132
......@@ -110,6 +110,7 @@ int debug = 0;
static int verbose = 0;
static int insecure = 0;
static int byteswritten = 0;
static char pidfile[MAXPATHLEN];
static char dbname[DBNAME_SIZE];
static struct in_addr myipaddr;
static char fshostid[HOSTID_SIZE];
......@@ -412,6 +413,7 @@ cleanup()
signal(SIGHUP, SIG_IGN);
killme = 1;
killpg(0, SIGHUP);
unlink(pidfile);
}
static void
......@@ -573,8 +575,8 @@ main(int argc, char **argv)
* Stash the pid away.
*/
mypid = getpid();
sprintf(buf, "%s/tmcd.pid", _PATH_VARRUN);
fp = fopen(buf, "w");
sprintf(pidfile, "%s/tmcd.pid", _PATH_VARRUN);
fp = fopen(pidfile, "w");
if (fp != NULL) {
fprintf(fp, "%d\n", mypid);
(void) fclose(fp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment