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.
This commit is contained in:
Scott Long 2003-01-07 07:46:50 +00:00
parent 45f603e21c
commit 9335d6884c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=108870
6 changed files with 76 additions and 12 deletions

View file

@ -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

View file

@ -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",

View file

@ -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);

View file

@ -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

View file

@ -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",

View file

@ -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);