From d8ff7fe878a3e835f1247449f4fe7098813adb7b Mon Sep 17 00:00:00 2001 From: scottl Date: Tue, 7 Jan 2003 07:46:50 +0000 Subject: Teach sysinstall about rpcbind, rpc.lockd, and rpc.statd. As an added bonus, rpcbind will be enabled automatically if rpc.lockd, rpc.statd, amd, NFS Server, or NIS is enabled. --- usr.sbin/sysinstall/config.c | 28 +++++++++++++++++++++++++++- usr.sbin/sysinstall/menus.c | 14 +++++++++----- usr.sbin/sysinstall/sysinstall.h | 2 ++ 3 files changed, 38 insertions(+), 6 deletions(-) (limited to 'usr.sbin/sysinstall') diff --git a/usr.sbin/sysinstall/config.c b/usr.sbin/sysinstall/config.c index 8a3b30f..0edeed4 100644 --- a/usr.sbin/sysinstall/config.c +++ b/usr.sbin/sysinstall/config.c @@ -964,6 +964,7 @@ int configNFSServer(dialogMenuItem *self) { char cmd[256]; + int retval = 0; /* If we're an NFS server, we need an exports file */ if (!file_readable("/etc/exports")) { @@ -994,13 +995,38 @@ configNFSServer(dialogMenuItem *self) systemExecute(cmd); } variable_set2(VAR_NFS_SERVER, "YES", 1); + retval = configRpcBind(NULL); restorescr(w); } else if (variable_get(VAR_NFS_SERVER)) { /* We want to turn it off again? */ vsystem("mv -f /etc/exports /etc/exports.disabled"); variable_unset(VAR_NFS_SERVER); } - return DITEM_SUCCESS; + return DITEM_SUCCESS | retval; +} + +/* + * Extend the standard dmenuToggleVariable() method to also check and set + * the rpcbind variable if needed. + */ +int +configRpcBind(dialogMenuItem *self) +{ + int retval = 0; + int doupdate = 1; + + if (self != NULL) { + retval = dmenuToggleVariable(self); + if (strcmp(variable_get(self->data), "YES") != 0) + doupdate = 0; + } + + if (doupdate && strcmp(variable_get(VAR_RPCBIND_ENABLE), "YES") != 0) { + variable_set2(VAR_RPCBIND_ENABLE, "YES", 1); + retval |= DITEM_REDRAW; + } + + return retval; } int diff --git a/usr.sbin/sysinstall/menus.c b/usr.sbin/sysinstall/menus.c index 4294de1..be89f05 100644 --- a/usr.sbin/sysinstall/menus.c +++ b/usr.sbin/sysinstall/menus.c @@ -1496,11 +1496,11 @@ DMenu MenuStartup = { { " named flags", "Set default flags to named (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "named_flags" }, { " nis client", "This host wishes to be an NIS client.", - dmenuVarCheck, dmenuToggleVariable, NULL, "nis_client_enable=YES" }, + dmenuVarCheck, configRpcBind, NULL, "nis_client_enable=YES" }, { " nis domainname", "Set NIS domainname (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "nisdomainname" }, { " nis server", "This host wishes to be an NIS server.", - dmenuVarCheck, dmenuToggleVariable, NULL, "nis_server_enable=YES" }, + dmenuVarCheck, configRpcBind, NULL, "nis_server_enable=YES" }, { " ", " -- ", NULL, NULL, NULL, NULL, ' ', ' ', ' ' }, { " accounting", "This host wishes to run process accounting.", dmenuVarCheck, dmenuToggleVariable, NULL, "accounting_enable=YES" }, @@ -1539,7 +1539,7 @@ DMenu MenuNetworking = { { " Interfaces", "Configure additional network interfaces", NULL, tcpMenuSelect }, { " AMD", "This machine wants to run the auto-mounter service", - dmenuVarCheck, dmenuToggleVariable, NULL, "amd_enable=YES" }, + dmenuVarCheck, configRpcBind, NULL, "amd_enable=YES" }, { " AMD Flags", "Set flags to AMD service (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "amd_flags" }, { " Anon FTP", "This machine wishes to allow anonymous FTP.", @@ -1556,8 +1556,12 @@ DMenu MenuNetworking = { dmenuVarCheck, dmenuSubmenu, NULL, &MenuNTP, '[', 'X', ']', "ntpdate_enable=YES" }, { " PCNFSD", "Run authentication server for clients with PC-NFS.", dmenuVarCheck, configPCNFSD, NULL, "pcnfsd" }, - { " portmap", "This machine wants to run the portmapper daemon", - dmenuVarCheck, dmenuToggleVariable, NULL, "portmap_enable=YES" }, + { " rpcbind", "RPC port mapping daemon (formerly portmapper)", + dmenuVarCheck, dmenuToggleVariable, NULL, "rpcbind_enable=YES" }, + { " rpc.statd", "NFS status monitoring daemon", + dmenuVarCheck, configRpcBind, NULL, "rpc_statd_enable=YES" }, + { " rpc.lockd", "NFS file locking daemon", + dmenuVarCheck, configRpcBind, NULL, "rpc_lockd_enable=YES" }, { " Routed", "Select routing daemon (default: routed)", dmenuVarCheck, configRouter, NULL, "router_enable=YES" }, { " Rwhod", "This machine wants to run the rwho daemon", diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h index 7ed0fab..0cf0110 100644 --- a/usr.sbin/sysinstall/sysinstall.h +++ b/usr.sbin/sysinstall/sysinstall.h @@ -172,6 +172,7 @@ #define VAR_NONINTERACTIVE "nonInteractive" #define VAR_NOVELL "novell" #define VAR_OSF1_ENABLE "osf1_enable" +#define VAR_RPCBIND_ENABLE "rpcbind_enable" #define VAR_NTPDATE_FLAGS "ntpdate_flags" #define VAR_PACKAGE "package" #define VAR_PARTITION "partition" @@ -526,6 +527,7 @@ extern int configRouter(dialogMenuItem *self); extern int configPCNFSD(dialogMenuItem *self); extern int configInetd(dialogMenuItem *self); extern int configNFSServer(dialogMenuItem *self); +extern int configRpcBind(dialogMenuItem *self); extern int configWriteRC_conf(dialogMenuItem *self); extern int configSecurityProfile(dialogMenuItem *self); extern int configSecurityExtreme(dialogMenuItem *self); -- cgit v1.1