Commit 53d89e86 authored by Leigh Stoller's avatar Leigh Stoller

Silly little change; write out a pid file to /var/run and use that to

kill running bootinfo in bootinfo.restart. Hey, its 6am.
parent d28fad64
......@@ -9,6 +9,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <paths.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
......@@ -55,6 +56,8 @@ main(int argc, char **argv)
boot_info_t boot_info;
boot_what_t *boot_whatp = (boot_what_t *) &boot_info.data;
int port = BOOTWHAT_DSTPORT;
char buf[BUFSIZ];
FILE *fp;
extern char build_info[];
progname = argv[0];
......@@ -92,6 +95,16 @@ main(int argc, char **argv)
}
info("%s\n", build_info);
/*
* Write out a pidfile.
*/
sprintf(buf, "%s/bootinfo.pid", _PATH_VARRUN);
fp = fopen(buf, "w");
if (fp != NULL) {
fprintf(fp, "%d\n", getpid());
(void) fclose(fp);
}
/* Initialize data base */
err = open_bootinfo_db();
if (err) {
......
......@@ -2,6 +2,8 @@
DIR=@prefix@/sbin
killall bootinfo
if [ -e /var/run/bootinfo.pid ]; then
kill `cat /var/run/bootinfo.pid`;
fi
${DIR}/bootinfo
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