Subject: pkg/10412: more errors in patches to GLUnix pkg
To: None <gnats-bugs@gnats.netbsd.org>
From: None <gr@eclipsed.net>
List: netbsd-bugs
Date: 06/22/2000 00:03:14
>Number:         10412
>Category:       pkg
>Synopsis:       more errors in patches to GLUnix pkg
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jun 22 00:04:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     gabriel rosenkoetter
>Release:        current pkgsrc as of this message
>Organization:
	Swarthmore College Computer Science Program
>Environment:
	
System: NetBSD sirius 1.4.2 NetBSD 1.4.2 (GENERIC) #0: Wed Mar 15 21:53:17 PST 2000 toddpw@leia.toddpw.net:/usr/src/sys/arch/macppc/compile/GENERIC macppc


>Description:

Though GLUnix successfully builds, it doesn't successfully run due to
a few errors in NetBSD patches (Tim Rightnour <garbled@netbsd.org>,
the original porter, presumably had it working on 1.3.x, but has
indicated that it may never have been perfect and obviously needs to
be updated for 1.4.x).  Thomas Klausner <wiz@netbsd.org> already
committed some changes I made a few days ago, here are a few more, I
doubt they're the last (GLUnix comes up most of the way now, but not
perfectly... I think there may be some bugs in GLUnix's rexec stuff
on NetBSD or in our patches to it).

The patches included below fix a few bugs: `hostname` where we really
need $(shell /bin/hostname) in a Gnu-style makefile; giving users
"ghorm" and "jcoates" privelege on machines where they don't exist
(and shouldn't); cosmetic removal of (confusing) references to
"CS.Berkeley.EDU"; and an incorrect regexp to match a successful ping
(ping says "0.0% packet loss", not "0% packet loss", but let's not
match anything that far out on the line, just the "1 packets
transmitted, 1 packets received" is plenty).

This is probably not the last installment, but I'm going home for the
night, and the remaining problem might only be that not all my nodes
have ssh installed via pkgsrc.

>How-To-Repeat:

Install pkgsrc/parallel/glunix, find that things look fairly okay, but
you can't glupart install without errors (which are not entirely
destroyed yet--sorry, just use the script instead of the suid binary),
nor run_glunix -start without having it complain about trying to reach
your master... `hostname`.

>Fix:

Replace the existing patches in pkgsrc/parallel/glunix/patches with
those attached below.

patch-ap:

--- CUT HERE ---
$NetBSD$

--- progs/Makefile.common.orig	Wed Nov  5 15:43:41 1997
+++ progs/Makefile.common	Wed Jun 21 15:54:25 2000
@@ -3,50 +3,30 @@
 # There are configuration values that are used in this Makefile and are
 # used to do substitutions in the scripts.
 # Use the environment variable GLUNIX_ARCH to manage multiple architectures
-ifeq ($(GLUNIX_ARCH),)
-  # This is the default architecture to build
-  GLUNIX_ARCH = sun4
-endif
-
-ifeq ($(GLUNIX_ARCH),sun4)
-  GLUNIX_OS = solaris2.4
-  GLUNIX_NET = tcp
-  GLUNIX_PLATFORM = $(GLUNIX_ARCH)-$(GLUNIX_OS)-$(GLUNIX_NET)
-  PERL_PATH = /usr/sww/bin/perl
-  MAIL_PATH = /usr/ucb/Mail
-  RSH_PATH = /usr/sww/bin/ssh
-  GLUNIX_DIR = /disks/barad-dur/now/glunix
-  GLUNIX_DATA_DIR = $(GLUNIX_DIR)/data
-  INSTALL_DIR = /usr/now
-  HTTP_BASE = /usr/now/share/etc/httpd/docs
-  MASTER_HOSTNAME = u.CS.Berkeley.EDU
-  GLUNIX_ACCOUNT = 12345
-  GLUNIX_GROUP = 311
-  PERL_LIB_DIR = $(GLUNIX_DIR)/release/progs/tools/perl-lib
-
-  INSTALL = /usr/sww/bin/ginstall
-endif
-ifeq ($(GLUNIX_ARCH),i386)
-  GLUNIX_OS = solaris2.6
-  GLUNIX_NET = tcp
-  GLUNIX_PLATFORM = $(GLUNIX_ARCH)-$(GLUNIX_OS)-$(GLUNIX_NET)
-  PERL_PATH = /usr/sww/bin/perl
-  MAIL_PATH = /usr/ucb/Mail
-  RSH_PATH = /usr/sww/bin/ssh
-  GLUNIX_DIR = /disks/barad-dur/now/glunix
-  GLUNIX_DATA_DIR = $(GLUNIX_DIR)/data
-  INSTALL_DIR = /usr/now
-  HTTP_BASE = 
-  MASTER_HOSTNAME = pc0.CS.Berkeley.EDU
-  GLUNIX_ACCOUNT = 12345
-  GLUNIX_GROUP = 311
-  PERL_LIB_DIR = $(GLUNIX_DIR)/release/progs/tools/perl-lib
 
-  INSTALL = /usr/now/bin/install
+ifeq ($(OPSYS),NetBSD)
+GLUNIX_BASE = $(WRKDIR)
+GLUNIX_SOURCE = $(WRKDIR)/glunix
+GLUNIX_ARCH = $(ARCH)
+GLUNIX_OS = $(OPSYS)
+GLUNIX_NET = tcp
+GLUNIX_PLATFORM = $(GLUNIX_ARCH)-$(GLUNIX_OS)-$(GLUNIX_NET)
+PERL_PATH = ${LOCALBASE}/bin/perl
+MAIL_PATH = /usr/bin/Mail
+RSH_PATH = ${LOCALBASE}/bin/ssh
+GLUNIX_DIR = $(NOW_ROOT)
+GLUNIX_DATA_DIR = $(NOW_ROOT)/data
+INSTALL_DIR = $(NOW_ROOT)
+HTTP_BASE = $(NOW_ROOT)/man/http
+MASTER_HOSTNAME = $(shell /bin/hostname)
+GLUNIX_ACCOUNT = 12345 # These don't matter, they're calculated at run-time
+GLUNIX_GROUP = 12345 # These don't matter, they're calculated at run-time
+PERL_LIB_DIR = $(GLUNIX_DIR)/lib/perl-lib
+INSTALL = /usr/bin/install
 endif
 
 # Paths to needed programs
-MHTML2HTML = /usr/now/bin/mhtml2html
+MHTML2HTML = $(GLUNIX_SOURCE)/bin/$(GLUNIX_PLATFORM)/mhtml2html
 
 ###########################################################################
 # Set up purify and quantify commands
@@ -58,7 +38,7 @@
 PURIFY_COMMAND = purify -cache-dir=/disks/barad-dur/now/glunix/data/purify/cache
 endif
 
-CC      = $(PURIFY_COMMAND) gcc
+CC      = gcc
 CFLAGS += -Wall -g $(RLIBPATH) $(LLIBPATH) $(INCPATH) $(LIBS) \
           -DGLUNIX_ARCH=$(GLUNIX_ARCH) -DGLUNIX_OS=$(GLUNIX_OS) \
           -DGLUNIX_NET=$(GLUNIX_NET) -DGLUNIX_PLATFORM=$(GLUNIX_PLATFORM) \
@@ -69,7 +49,7 @@
           -DGLUNIX_ACCOUNT=$(GLUNIX_ACCOUNT) -DGLUNIX_GROUP=$(GLUNIX_GROUP)
 MKDIR   = $(INSTALL) -d -m 0775 -g glunix
 INSTALL_BIN  = $(INSTALL) -m 0775 -g glunix
-INSTALL_MAN  = $(INSTALL) -m 0664 -g glunix
+INSTALL_MAN  = $(INSTALL) -c -m 0664 -g glunix
 MHTML_TO_NROFF = $(MHTML2HTML) nroff
 MHTML_TO_HTML  = $(MHTML2HTML) html
 
@@ -96,6 +76,7 @@
 #      %%GLUNIX_GROUP%%
 STANDARD_XLATE = sed -e 's,%%PERL_PATH%%,$(PERL_PATH),g' \
                      -e 's,%%MAIL_PATH%%,$(MAIL_PATH),g' \
+                     -e 's,%%GLUNIX_BASE%%,$(GLUNIX_BASE),g' \
                      -e 's,%%RSH_PATH%%,$(RSH_PATH),g' \
                      -e 's,%%GLUNIX_ARCH%%,$(GLUNIX_ARCH),g' \
                      -e 's,%%GLUNIX_OS%%,$(GLUNIX_OS),g' \
@@ -111,10 +92,10 @@
                      -e 's,%%GLUNIX_GROUP%%,$(GLUNIX_GROUP),g' \
                      $^ > $@ ; chmod +x $@
 
-MANHOME_MHTML = ../../man/mhtml
-MANHOME_HTML  = ../../man/html
-MANHOME_NROFF = ../../man/man
-BINHOME       = ../../bin/$(GLUNIX_PLATFORM)
+MANHOME_MHTML = ../../glunix/man/mhtml
+MANHOME_HTML  = ../../glunix/man/html
+MANHOME_NROFF = ../../glunix/man/man
+BINHOME       = ../../glunix/bin/$(GLUNIX_PLATFORM)
 
 ifneq ($(origin GLUNIX_DEVEL),undefined)
 
@@ -123,8 +104,8 @@
 
 else
 
-GLUNIX_LIBPATH = $(INSTALL_DIR)/lib
-GLUNIX_INCLUDEPATH = $(INSTALL_DIR)/include
+GLUNIX_LIBPATH = $(GLUNIX_SOURCE)/lib/$(GLUNIX_PLATFORM)
+GLUNIX_INCLUDEPATH = $(GLUNIX_SOURCE)/include
 
 endif
 
@@ -166,4 +147,4 @@
 else
 installman:
 	@echo No manpages to install.
-endif
+endif
--- CUT HERE ---

patch-bh:

--- CUT HERE ---
$NetBSD$

--- progs/tools/run_glunix_script.pl.orig	Wed Nov  5 15:44:28 1997
+++ progs/tools/run_glunix_script.pl	Thu Jun 22 00:31:41 2000
@@ -6,20 +6,21 @@
 # These machines have to be able to do a root rsh to all other machines in
 # the cluster.
 @ok_hostnames = ("%%MASTER_HOSTNAME%%");
-@ok_people = ("ghorm", "glunix", "root");    # These people are allowed to
-                                             # modify the production cluster
-@dont_notify_people = ("ghorm", "jcoates");  # Don't send mail if these people
-                                             # do things.
+@ok_people = ("glunix", "root");	# These people are allowed to
+					# modify the production cluster
+@dont_notify_people = ();		# Don't send mail if these people
+					# do things.
 
 $root_dir = "%%GLUNIX_DIR%%";
 $data_dir = "%%GLUNIX_DATA_DIR%%";
-$release_dir = "$root_dir/release";
+$release_dir = "$root_dir";
 $devel_dir = "$root_dir/devel";
 $perl_lib = "%%PERL_LIB_DIR%%";
 $run_glunix_agent = "%%INSTALL_DIR%%/bin/run_glunix_agent";
-$command_master = "u";    # The preferred location of the master
+# The preferred location of the master
+$command_master = "%%MASTER_HOSTNAME%%";    
 $mail_cmd = "%%MAIL_PATH%%";
-$admin_email = "glunix-admin\@now.cs";
+$admin_email = "root";
 $questions_email = "glunix\@now.cs.berkeley.edu";
 $glunix_platform = "%%GLUNIX_PLATFORM%%";
 $rsh_command = "%%RSH_PATH%%";
@@ -548,8 +549,8 @@
 	    next;
 	}
 	$full_hostname = &expand_hostname($host);
-	$ping_str = `/usr/sbin/ping -v $full_hostname 2`;
-	if ($ping_str =~ m/$full_hostname.* is alive/) {
+	$ping_str = `/sbin/ping -o $full_hostname`;
+	if ($ping_str =~ m/1 packets transmitted, 1 packets received/) {
 	    push(@alive, $host);
 	    print "$host ";
 	} else {
@@ -1097,7 +1098,7 @@
 
     foreach $pid (keys %children) {
 	kill(2, $pid);
-	print STDERR &expand_hostname(${children{$pid}}), ".CS.Berkeley.EDU: timed out\n";
+	print STDERR &expand_hostname(${children{$pid}}), ": timed out\n";
     }
 }
 
--- CUT HERE ---
>Release-Note:
>Audit-Trail:
>Unformatted: