summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Ginies <aginies@mandriva.com>2005-01-28 10:31:43 +0000
committerAntoine Ginies <aginies@mandriva.com>2005-01-28 10:31:43 +0000
commit43818610d2e97f3549b15d366bf1a38b48f4b481 (patch)
tree25c8329887653b7ba8dde2f481f4419fd8800217
parentc9448c94f4707bd577a4346aa1aa9b25d4aa9f1e (diff)
downloaddrakwizard-43818610d2e97f3549b15d366bf1a38b48f4b481.tar
drakwizard-43818610d2e97f3549b15d366bf1a38b48f4b481.tar.gz
drakwizard-43818610d2e97f3549b15d366bf1a38b48f4b481.tar.bz2
drakwizard-43818610d2e97f3549b15d366bf1a38b48f4b481.tar.xz
drakwizard-43818610d2e97f3549b15d366bf1a38b48f4b481.zip
correct several bugs (thx FACORAT Fabrice report)
-rw-r--r--nisautofs_wizard/Nisautofs.pm65
1 files changed, 3 insertions, 62 deletions
diff --git a/nisautofs_wizard/Nisautofs.pm b/nisautofs_wizard/Nisautofs.pm
index cda45780..514bec7d 100644
--- a/nisautofs_wizard/Nisautofs.pm
+++ b/nisautofs_wizard/Nisautofs.pm
@@ -57,40 +57,19 @@ my $o = {
AUTOMASTER => $AUTOMASTER,
AUTOHOME => $AUTOHOME,
},
- needed_rpm => [ 'ypbind', 'nfs-utils', 'yp-tools', 'nfs-utils-clients' ],
+ needed_rpm => [ 'ypserv', 'ypbind', 'nfs-utils', 'yp-tools', 'nfs-utils-clients' ],
defaultimage => "$ENV{__WIZ_HOME__}/nisautofs_wizard/images/nisautofs.png",
init => sub {
test_host_domain($HOST, $NISDOMAIN);
},
};
-my %level = (
- 1 => N("NIS server with autofs map"),
- 2 => N("NIS client"),
- );
-
$o->{pages} = {
welcome => {
name => N("NIS server with autofs map") . "\n\n" . N("Setup a NIS server with autofs map, auto.home and auto.master files.") . "\n\n" . N("Users automatically mount their home directory from server, when they log on a NIS client computer network."),
no_back => 1,
- pre => sub { $o->{var}{wiz_level} ||= 1 },
- post => sub { if ($o->{var}{wiz_level} == 2) {
- return 'nis_client'
- }
- },
- data => [
- { label => N("What do you want to do?"), val => \$o->{var}{wiz_level}, list => [ keys %level ], format => sub { $level{$_[0]} } },
- ],
next => 'nis_server',
},
- nis_client => {
- name => N("Configure computer to be a NIS client") . "\n\n" . N("You just have to put nisdomain and nisserver."),
- data => [
- { label => N("NIS server:"), val => \$o->{var}{NISSERVER} },
- { label => N("NIS domain:"), val => \$o->{var}{NISDOMAIN} },
- ],
- next => 'summaryclient',
- },
nis_server => {
name => N("NIS server with autofs map") . "\n\n" . N("A NIS server is useful to create user, hostname database. The wizard builds autofs map, so it will provide the capabilities for NIS user to automount their home directory on a NIS client computer.") . "\n\n" . N("NIS server: name of your computer.") . "\n" . N("Home NIS: home base directory for users on NIS server. This directory will be exported through NFS server.") . "\n" . N("NIS domain: NIS domain to use (generally same as your DNS domain name)."),
data => [
@@ -116,15 +95,6 @@ $o->{pages} = {
post => \&do_it_server,
next => 'endserver',
},
- summaryclient => {
- name => N("The YPBIND daemon finds the server for NIS domains and maintains the NIS binding information.") . "\n\n" . N("NIS server: hostname of the NIS server.") . "\n" . N("NIS domainname: name of NIS domain."),
- data => [
- { label => N("NIS server:"), fixed_val => \$o->{var}{NISSERVER} },
- { label => N("NIS domainname:"), fixed_val => \$o->{var}{NISDOMAIN} },
- ],
- post => \&do_it_client,
- next => 'endclient',
- },
error_homedir => {
name => N("Error: should be a directory."),
next => 'nis_server',
@@ -134,13 +104,6 @@ $o->{pages} = {
end => 1,
next => 0,
},
- endclient => {
- name => N("Congratulations"),
- data => [ { label => N("The wizard successfully configured your machine to be a NIS client.") } ],
- no_back => 1,
- end => 1,
- next => 0
- },
endserver => {
name => N("Congratulations"),
data => [ { label => N("The wizard successfully configured your machine to be a NIS server with autofs map.") } ],
@@ -200,6 +163,7 @@ sub nfs_home_nis {
# configure /etc/auto.*
sub configure_auto {
+ $HOMENIS = $o->{var}{HOMENIS};
save_config($AUTOMASTER);
my $nisserver = chomp_($o->{var}{NISSERVER});
output($AUTOMASTER, <<EOF);
@@ -307,8 +271,6 @@ sub do_it_server {
my $w = $in->wait_message(N("NIS with Autofs map"), N("Configuring your system to be a NIS server with Autofs map..."));
# system("urpme --auto autofs") if (system("/bin/rpm -q autofs >/dev/null"));
uninstall_rpm('autofs');
- system("urpmi --auto ypserv");
- needed_service('ypserv');
# configure autofs to fit nis
configure_auto();
# set correct nis
@@ -327,31 +289,10 @@ sub do_it_server {
# restart all needed services
needed_service($_) foreach qw(ypserv nfs);
undef $w;
+ needed_service("ypbind");
check_started($_) foreach qw(ypserv nfsd);
}
-sub do_it_client {
- return if $::testing;
- my $in = 'interactive'->vnew('su', 'nisautofsclient');
- my $w = $in->wait_message(N("NIS client"), N("Configuring your system as NIS client ..."));
- uninstall_rpm('ypserv');
- system("urpmi --auto autofs");
- test_autofile();
- # set correct nis
- set_nisdomain();
- # update client conf file (also on server)
- update_yp(chomp_($o->{var}{NISDOMAIN}), chomp_($o->{var}{NISSERVER}));
- # update conf file
- update_network();
- # update nsswitch.conf
- substInFile {
- s|automount:.*|automount: files nisplus nis|;
- } "/etc/nsswitch.conf";
- needed_service($_) foreach qw(ypbind autofs);
- undef $w;
- check_started($_) foreach qw(ypbind autofs);
-}
-
sub new {
my ($class) = @_;
bless {