Great Circle Associates Majordomo-Workers
(March 2001)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Put wrapper and family in different subdir?
From: Rob Windsor <windsor @ warthog . com>
Date: Thu, 15 Mar 2001 16:50:00 -0600
To: majordomo-workers @ greatcircle . com
Reply-to: Rob Windsor <windsor @ warthog . com>

I've been tweaking with majordomo for the last four years, and have reecently
decided that I'd rather not let wrapper execute anything and everything in
${W_HOME} since this seems to be a catch-all subdir for majordomo work.

So, instead, I set the build up to use ${W_HOME}/sbin for wrapper and the
scripts that it needs to call upon.  I've been running with this setup
since last Nov and it appears to be working properly.

I think that you guys should seriously consider not dumping everything
(wrapper, scripts for wrapper, config files, etc) into one directory.
I've made a good step in the this direction, but may not be as polished
as you want to see.  Anyway, my patch is attached behind the .sig.

Enjoy.

Rob++
----------------------------------------
Internet: windsor@warthog.com                             __o
Life: Rob@Carrollton.Texas.USA.Earth                    _`\<,_
                                                       (_)/ (_)
The weather is here, wish you were beautiful.
--- patch ---
diff -r -u ../../src/majordomo-1.94.5/Makefile ./Makefile
--- ../../src/majordomo-1.94.5/Makefile	Tue Jan 18 08:01:17 2000
+++ ./Makefile	Thu Mar 15 16:28:19 2001
@@ -15,6 +15,9 @@
 # Put the location of your Perl binary here:
 PERL = /bin/perl
 
+# Put the location of your sendmail binary here:
+SENDMAIL = /usr/sbin/sendmail
+
 # What do you call your C compiler?
 CC = cc
  
@@ -75,7 +78,7 @@
 # For those stupid machines that try to use csh. Doh!
 SHELL = /bin/sh
 
-WRAPPER_FLAGS = -DBIN=\"$(W_HOME)\" -DPATH=\"PATH=$(W_PATH)\" \
+WRAPPER_FLAGS = -DBIN=\"$(W_HOME)/sbin\" -DPATH=\"PATH=$(W_PATH)\" \
 	-DHOME=\"HOME=$(W_HOME)\" -DSHELL=\"SHELL=$(W_SHELL)\" \
 	-DMAJORDOMO_CF=\"MAJORDOMO_CF=$(W_MAJORDOMO_CF)\"      \
 	$(POSIX)
@@ -111,19 +114,19 @@
 	@echo ""
 	@echo "If not installing the wrapper, type"
 	@echo ""
-	@echo "	    cd $(W_HOME); ./wrapper config-test"
+	@echo "	    cd $(W_HOME)/sbin; ./wrapper config-test"
 	@echo ""
 	@echo "(no 'su' necessary) to verify the installation."
 
 
 install-wrapper: wrapper
 	$(INSTALL) -o $(WRAPPER_OWNER) -g $(WRAPPER_GROUP) \
-		-m $(WRAPPER_MODE) wrapper $(W_HOME)/wrapper
+		-m $(WRAPPER_MODE) wrapper $(W_HOME)/sbin/wrapper
 	@echo ""
 	@echo "To verify that all the permissions and etc are correct,"
 	@echo "run the command"
 	@echo ""
-	@echo "	     cd $(W_HOME); ./wrapper config-test"
+	@echo "	     cd $(W_HOME)/sbin; ./wrapper config-test"
 
 # fix where perl lives.
 # Create a tmp directory to stuff all the files in, so we 
@@ -134,17 +137,20 @@
 	@test -f $(PERL) -a -x $(PERL) || \
 		{ echo "You didn't correctly tell me where Perl is."; exit 1; } 
 	@rm -rf $(TMP); mkdir $(TMP)
+	@test -f $(SENDMAIL) -a -x $(SENDMAIL) || \
+		{ echo "You didn't correctly tell me where sendmail is." ; \
+			exit 1 ; }
 	@echo "Configuring scripts..."
 	@for file in $(TOOLS); do \
 		cp contrib/$$file $(TMP) ; \
 	done
 	@cp $(BINBIN) $(BIN) $(TMP)
-	@cd $(TMP);	$(PERL) -p -i -e 's@^#!\S+perl.*@#!$(PERL)@' $(TOOLS) $(BINBIN) $(BIN) 
+	@cd $(TMP);	$(PERL) -p -i -e 's@^#!\S+perl.*@#!$(PERL)@ ; s@/usr/lib/sendmail@$(SENDMAIL)@' $(TOOLS) $(BINBIN) $(BIN) 
 
 
 install-scripts: config-scripts
-	$(INSTALL) -m $(HOME_MODE) $(INSTALL_FLAGS) . $(W_HOME)
 	$(INSTALL) -m $(EXEC_MODE) $(INSTALL_FLAGS) . $(W_HOME)/bin
+	$(INSTALL) -m $(EXEC_MODE) $(INSTALL_FLAGS) . $(W_HOME)/sbin
 
 	@echo "Copying tools to $(W_HOME)/bin"
 
@@ -153,20 +159,18 @@
 			$(TMP)/$$file $(W_HOME)/bin/$$file; \
 	done
 
-	@echo "Copying Majordomo files to $(W_HOME)"
+	@echo "Copying Majordomo files to $(W_HOME)/sbin"
 
 	@for file in $(BIN); do \
 		$(INSTALL) -m $(EXEC_MODE) $(INSTALL_FLAGS) \
-			$(TMP)/$$file $(W_HOME)/$$file; \
+			$(TMP)/$$file $(W_HOME)/sbin/$$file; \
 	done
 
-	@echo "Copying archiving and other tools to $(W_HOME)/Tools"
-
-	$(INSTALL) -m $(EXEC_MODE) $(INSTALL_FLAGS) . $(W_HOME)/Tools
+	@echo "Copying archiving and other tools to $(W_HOME)/bin"
 
 	@for file in $(TOOLS); do \
 		$(INSTALL) -m $(EXEC_MODE) $(INSTALL_FLAGS) \
-			$(TMP)/$$file $(W_HOME)/Tools/$$file; \
+			$(TMP)/$$file $(W_HOME)/bin/$$file; \
 	done
 
 	@rm -rf $(TMP)	
diff -r -u ../../src/majordomo-1.94.5/archive2.pl ./archive2.pl
--- ../../src/majordomo-1.94.5/archive2.pl	Fri Jan  7 05:00:49 2000
+++ ./archive2.pl	Thu Mar 15 15:43:37 2001
@@ -60,7 +60,7 @@
 require "$cf";
 
 # All these should be in the standard PERL library
-unshift(@INC, $homedir);
+unshift(@INC, "$homedir/sbin");
 require "ctime.pl";		# To get MoY definitions for month abbrevs
 require "majordomo_version.pl";	# What version of Majordomo is this?
 require "majordomo.pl";		# all sorts of general-purpose Majordomo subs
diff -r -u ../../src/majordomo-1.94.5/bounce-remind ./bounce-remind
--- ../../src/majordomo-1.94.5/bounce-remind	Mon Dec  9 10:49:46 1996
+++ ./bounce-remind	Thu Mar 15 15:44:41 2001
@@ -33,7 +33,7 @@
 chdir("$homedir");
 
 # All these should be in the standard PERL library
-unshift(@INC, $homedir);
+unshift(@INC, "$homedir/sbin");
 
 # Set these here so that they can be interploated on the $mailer command line.
 $sender = "nobody\@$whereami";
diff -r -u ../../src/majordomo-1.94.5/config-test ./config-test
--- ../../src/majordomo-1.94.5/config-test	Wed Aug 27 10:17:13 1997
+++ ./config-test	Thu Mar 15 15:46:21 2001
@@ -125,6 +125,8 @@
     &bad("something's wrong with $cf: $@");
 }
 
+unshift(@INC, "$homedir/sbin");
+
 foreach (@requires) {
     if (require $_) {
 	&good("found $_ okay.");
@@ -138,8 +140,6 @@
 print "You're running Majordomo Version $majordomo_version.\n";
 
 print "\n--==> Majordomo home directory is $homedir.\n";
-
-unshift(@INC, $homedir);
 
 &header("Include directories");
 foreach (@INC) {
diff -r -u ../../src/majordomo-1.94.5/digest ./digest
--- ../../src/majordomo-1.94.5/digest	Fri Jan  7 05:04:34 2000
+++ ./digest	Thu Mar 15 15:47:08 2001
@@ -20,6 +20,7 @@
 
 
 &init;
+unshift(@INC, "/etc/mail/majordomo/sbin");
 &readconfig;
 $TEMP = (defined $TMPDIR && -d $TMPDIR) ?
 	"$TMPDIR/digest.$$" : "/usr/tmp/digest.$$";
diff -r -u ../../src/majordomo-1.94.5/majordomo ./majordomo
--- ../../src/majordomo-1.94.5/majordomo	Thu Jan 13 11:29:31 2000
+++ ./majordomo	Thu Mar 15 15:48:10 2001
@@ -58,7 +58,7 @@
 print STDERR "$0: starting\n" if $DEBUG;
 
 # All these should be in the standard PERL library
-unshift(@INC, $homedir);
+unshift(@INC, "$homedir/sbin");
 require "ctime.pl";		# To get MoY definitions for month abbrevs
 require "majordomo_version.pl";	# What version of Majordomo is this?
 require "majordomo.pl";		# all sorts of general-purpose Majordomo subs
@@ -1095,7 +1095,7 @@
 	# The password is valid, so run digest
 
     	    open(DIGEST, 
-		"$homedir/digest -m -C -l $list $list_outgoing 2>&1 |");
+		"$homedir/sbin/digest -m -C -l $list $list_outgoing 2>&1 |");
 	    @digest_errors = <DIGEST>;
 	    close(DIGEST);
 
diff -r -u ../../src/majordomo-1.94.5/request-answer ./request-answer
--- ../../src/majordomo-1.94.5/request-answer	Fri Jan  7 05:10:18 2000
+++ ./request-answer	Thu Mar 15 15:49:48 2001
@@ -26,7 +26,7 @@
 require "$cf";
 
 chdir($homedir) || die("Can't chdir(\"$homedir\"): $!");
-unshift(@INC, $homedir);
+unshift(@INC, "$homedir/sbin");
 require "shlock.pl";
 require "majordomo.pl";
 
diff -r -u ../../src/majordomo-1.94.5/resend ./resend
--- ../../src/majordomo-1.94.5/resend	Fri Jan  7 09:32:39 2000
+++ ./resend	Thu Mar 15 15:50:54 2001
@@ -92,7 +92,7 @@
 
 chdir($homedir) || die("Can't chdir(\"$homedir\"): $!");
 
-unshift(@INC, $homedir);
+unshift(@INC, "$homedir/sbin");
 require "ctime.pl";  # For logging purposes
 require "majordomo.pl";
 require "majordomo_version.pl";



Indexed By Date Previous: HTML stripper is ready
From: "Andreas S. Oesterhelt" <oes@oesterhelt.dyndns.org>
Next: advertise/noadvertise options ...
From: The Hermit Hacker <scrappy@hub.org>
Indexed By Thread Previous: HTML stripper is ready
From: "Andreas S. Oesterhelt" <oes@oesterhelt.dyndns.org>
Next: advertise/noadvertise options ...
From: The Hermit Hacker <scrappy@hub.org>

Google
 
Search Internet Search www.greatcircle.com