Make the name of the init script and the interpreter compile time options.

If not defined, default to the old values (with _PATH_BSHELL instead
of "/bin/sh", though).

Reviewed by:	markm
This commit is contained in:
Alexander Langer 2001-01-20 09:12:55 +00:00
parent 7dd2de5bc2
commit 5a86d4eafc
2 changed files with 26 additions and 7 deletions

View File

@ -1,9 +1,19 @@
# $FreeBSD$
#
PROG=oinit
#CFLAGS+=-DUSE_HISTORY
CFLAGS+=-DOINIT_RC=\"/etc/oinit.rc\"
#LDADD=-lutil -ledit -ltermcap
PROG= oinit
SH_PATH?= /bin/sh
SH_NAME?= -sh
SH_ARG?= /etc/rc
CFLAGS= -DSH_PATH=\"${SH_PATH}\" -DSH_NAME=\"${SH_NAME}\" \
-DSH_ARG=\"${SH_ARG}\"
#CFLAGS+= -DUSE_HISTORY
#CFLAGS+= -DOINIT_RC=\"/etc/oinit.rc\"
#LDADD= -lutil -ledit -ltermcap
LDADD=-lutil
NOMAN=yes

View File

@ -599,6 +599,15 @@ start_session(int vty, int argc, char **argv)
* normal /etc/rc interpreted by Bourne shell.
*/
#ifndef OINIT_RC
#ifndef SH_NAME
#define SH_NAME "-sh"
#endif
#ifndef SH_PATH
#define SH_PATH _PATH_BSHELL
#endif
#ifndef SH_ARG
#define SH_ARG "/etc/rc"
#endif
void
runcom()
{
@ -617,10 +626,10 @@ runcom()
dup2(fd,1);
dup2(fd,2);
if(fd>2) close(fd);
argv[0]="-sh";
argv[1]="/etc/rc";
argv[0]=SH_NAME;
argv[1]=SH_ARG;
argv[2]=0;
execvp("/bin/sh",argv);
execvp(SH_PATH,argv);
printf("runcom(): %s\n",strerror(errno));
_exit(1);
}