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 "nk/log.h"
#include "nk/privilege.h"
#include "nk/pidfile.h"
#include "nk/signals.h"
#include "nk/io.h"
@ -67,7 +66,6 @@ static int resolv_conf_fd = -1;
/* If true, allow HOSTNAME changes from dhcp server. */
int allow_hostname = 0;
char pidfile_ifch[PATH_MAX] = PID_FILE_IFCH_DEFAULT;
uid_t ifch_uid = 0;
gid_t ifch_gid = 0;
@ -382,11 +380,6 @@ static void do_ifch_work(void)
void ifch_main(void)
{
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);
setup_signals_ifch();

View File

@ -33,7 +33,6 @@ struct ifchd_client {
extern struct ifchd_client cl;
extern int allow_hostname;
extern char pidfile_ifch[PATH_MAX];
extern uid_t ifch_uid;
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.
The default is to not write the process id number into any file at all.
.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
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.

View File

@ -106,7 +106,6 @@ static void show_usage(void)
" -b, --background Fork to background if lease cannot be\n"
" immediately negotiated.\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"
" -n, --now Exit with failure if lease cannot be\n"
" immediately negotiated.\n"
@ -458,7 +457,6 @@ static void parse_program_options(int argc, char *argv[])
{"clientid", required_argument, 0, 'c'},
{"background", no_argument, 0, 'b'},
{"pidfile", required_argument, 0, 'p'},
{"ifch-pidfile", required_argument, 0, 'P'},
{"hostname", required_argument, 0, 'h'},
{"interface", required_argument, 0, 'i'},
{"now", no_argument, 0, 'n'},
@ -501,10 +499,6 @@ static void parse_program_options(int argc, char *argv[])
case 'p':
copy_cmdarg(pidfile, optarg, sizeof pidfile, "pidfile");
break;
case 'P':
copy_cmdarg(pidfile_ifch, optarg, sizeof pidfile_ifch,
"ifch-pidfile");
break;
case 'h':
copy_cmdarg(client_config.hostname, optarg,
sizeof client_config.hostname, "hostname");