mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-17 15:27:36 +00:00
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:
parent
7dd2de5bc2
commit
5a86d4eafc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=71295
@ -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
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user