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:
scottl 2003-01-07 07:46:50 +00:00
parent 00566d3f8e
commit 5d2401e623
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);