Subject: bin/4766: init(8) does not build if -DALTSHELL is not configured
To: None <gnats-bugs@gnats.netbsd.org>
From: The Grey Wolf <greywolf@starwolf.com>
List: netbsd-bugs
Date: 01/03/1998 11:57:25
>Number:         4766
>Category:       bin
>Synopsis:       init does not build without -DALTSHELL configured
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan  3 12:05:00 1998
>Last-Modified:
>Originator:     The Grey Wolf
>Organization:
Star Wolf Innovations
>Release:        NetBSD 1.3
>Environment:
	SPARCstation 4/50 (IPX), NetBSD 1.3_BETA release
System: NetBSD starwolf.starwolf.com 1.3_BETA NetBSD 1.3_BETA (STARWOLF) #6: Sun Nov 30 20:50:28 PST 1997 greywolf@starwolf.starwolf.com:/usr/src/sys/arch/sparc/compile/STARWOLF sparc


>Description:
	If one builds init without -DALTSHELL in the Makefile,
	it will bomb out complaining that "variable shell is not used".
>How-To-Repeat:
	# cd /usr/src/sbin/init
	# ed Makefile
	/CPPFLAGS/s/-DALTSHELL//
	w
	q
	# touch init.c
	# make
>Fix:
	Patch to init.c
*** init.c	Sat Jan  3 00:00:04 1998
--- init.c.orig	Fri Jan  2 15:51:06 1998
***************
*** 661,669 ****
  		execv(shell, argv);
  		emergency("can't exec %s for single user: %m", shell);
  		argv[0] = "-sh";
- 		shell = _PATH_BSHELL;
  #endif /* ALTSHELL */
! 		execv(shell, argv);
  		emergency("can't exec %s for single user: %m", _PATH_BSHELL);
  		sleep(STALL_TIMEOUT);
  		_exit(1);
--- 661,668 ----
  		execv(shell, argv);
  		emergency("can't exec %s for single user: %m", shell);
  		argv[0] = "-sh";
  #endif /* ALTSHELL */
! 		execv(_PATH_BSHELL, argv);
  		emergency("can't exec %s for single user: %m", _PATH_BSHELL);
  		sleep(STALL_TIMEOUT);
  		_exit(1);
>Audit-Trail:
>Unformatted: