ifch doesn't need to save a pidfile because its lifetime is strictly bounded

by that of ndhc by the shared pipe, so remove that option.
This commit is contained in:
Nicholas J. Kain 2014-04-06 02:27:52 -04:00
parent 6b1d422d6f
commit 812912126e
4 changed files with 0 additions and 18 deletions

View File

@ -44,7 +44,6 @@
#include <getopt.h> #include <getopt.h>
#include "nk/log.h" #include "nk/log.h"
#include "nk/privilege.h" #include "nk/privilege.h"
#include "nk/pidfile.h"
#include "nk/signals.h" #include "nk/signals.h"
#include "nk/io.h" #include "nk/io.h"
@ -67,7 +66,6 @@ static int resolv_conf_fd = -1;
/* If true, allow HOSTNAME changes from dhcp server. */ /* If true, allow HOSTNAME changes from dhcp server. */
int allow_hostname = 0; int allow_hostname = 0;
char pidfile_ifch[PATH_MAX] = PID_FILE_IFCH_DEFAULT;
uid_t ifch_uid = 0; uid_t ifch_uid = 0;
gid_t ifch_gid = 0; gid_t ifch_gid = 0;
@ -382,11 +380,6 @@ static void do_ifch_work(void)
void ifch_main(void) void ifch_main(void)
{ {
prctl(PR_SET_NAME, "ndhc: ifch"); prctl(PR_SET_NAME, "ndhc: ifch");
if (file_exists(pidfile_ifch, "w") == -1)
suicide("FATAL - can't open ifch-pidfile '%s' for write!",
pidfile_ifch);
write_pid(pidfile_ifch);
memset(pidfile_ifch, '\0', sizeof pidfile_ifch);
umask(077); umask(077);
setup_signals_ifch(); setup_signals_ifch();

View File

@ -33,7 +33,6 @@ struct ifchd_client {
extern struct ifchd_client cl; extern struct ifchd_client cl;
extern int allow_hostname; extern int allow_hostname;
extern char pidfile_ifch[PATH_MAX];
extern uid_t ifch_uid; extern uid_t ifch_uid;
extern gid_t ifch_gid; extern gid_t ifch_gid;

View File

@ -39,10 +39,6 @@ Immediately fork into the background, even before obtaining a lease.
Write the process id number of the ndhc process into the specified file name. Write the process id number of the ndhc process into the specified file name.
The default is to not write the process id number into any file at all. The default is to not write the process id number into any file at all.
.TP .TP
.BI \-P\ PIDFILE ,\ \-\-ifch\-pidfile= PIDFILE
Write the process id number of the ndhc-ifch process into the specified file
name. The default is to not write the process id number into any file at all.
.TP
.BI \-l\ LEASEFILE ,\ \-\-leasefile= LEASEFILE .BI \-l\ LEASEFILE ,\ \-\-leasefile= LEASEFILE
Write the IP address of the currently held DHCP lease into the specified file Write the IP address of the currently held DHCP lease into the specified file
name. The default is to not write the lease IP address into any file at all. name. The default is to not write the lease IP address into any file at all.

View File

@ -106,7 +106,6 @@ static void show_usage(void)
" -b, --background Fork to background if lease cannot be\n" " -b, --background Fork to background if lease cannot be\n"
" immediately negotiated.\n" " immediately negotiated.\n"
" -p, --pidfile=FILE File where the ndhc pid will be written\n" " -p, --pidfile=FILE File where the ndhc pid will be written\n"
" -P, --ifch-pidfile=FILE File where the ndhc-ifch pid will be written\n"
" -i, --interface=INTERFACE Interface to use (default: eth0)\n" " -i, --interface=INTERFACE Interface to use (default: eth0)\n"
" -n, --now Exit with failure if lease cannot be\n" " -n, --now Exit with failure if lease cannot be\n"
" immediately negotiated.\n" " immediately negotiated.\n"
@ -458,7 +457,6 @@ static void parse_program_options(int argc, char *argv[])
{"clientid", required_argument, 0, 'c'}, {"clientid", required_argument, 0, 'c'},
{"background", no_argument, 0, 'b'}, {"background", no_argument, 0, 'b'},
{"pidfile", required_argument, 0, 'p'}, {"pidfile", required_argument, 0, 'p'},
{"ifch-pidfile", required_argument, 0, 'P'},
{"hostname", required_argument, 0, 'h'}, {"hostname", required_argument, 0, 'h'},
{"interface", required_argument, 0, 'i'}, {"interface", required_argument, 0, 'i'},
{"now", no_argument, 0, 'n'}, {"now", no_argument, 0, 'n'},
@ -501,10 +499,6 @@ static void parse_program_options(int argc, char *argv[])
case 'p': case 'p':
copy_cmdarg(pidfile, optarg, sizeof pidfile, "pidfile"); copy_cmdarg(pidfile, optarg, sizeof pidfile, "pidfile");
break; break;
case 'P':
copy_cmdarg(pidfile_ifch, optarg, sizeof pidfile_ifch,
"ifch-pidfile");
break;
case 'h': case 'h':
copy_cmdarg(client_config.hostname, optarg, copy_cmdarg(client_config.hostname, optarg,
sizeof client_config.hostname, "hostname"); sizeof client_config.hostname, "hostname");