summaryrefslogtreecommitdiff
path: root/runit
diff options
context:
space:
mode:
authorDenys Vlasenko2011-03-08 21:00:36 +0100
committerDenys Vlasenko2011-03-08 21:00:36 +0100
commit681efe20d327e9e6774b174a617d66bbb9d21f48 (patch)
tree4331e443ee303c24364b1655651c8584db8b51c1 /runit
parent86cf0364bd58e07646a23a1128e4a9ea79189579 (diff)
downloadbusybox-681efe20d327e9e6774b174a617d66bbb9d21f48.zip
busybox-681efe20d327e9e6774b174a617d66bbb9d21f48.tar.gz
use user's shell instead of hardwired "/bin/sh" (android needs this)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'runit')
-rw-r--r--runit/svlogd.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/runit/svlogd.c b/runit/svlogd.c
index cfa20a7..b0ba21b 100644
--- a/runit/svlogd.c
+++ b/runit/svlogd.c
@@ -187,6 +187,7 @@ struct globals {
unsigned nearest_rotate;
void* (*memRchr)(const void *, int, size_t);
+ char *shell;
smallint exitasap;
smallint rotateasap;
@@ -382,6 +383,9 @@ static void processorstart(struct logdir *ld)
/* vfork'ed child trashes this byte, save... */
sv_ch = ld->fnsave[26];
+ if (!G.shell)
+ G.shell = xstrdup(get_shell_name());
+
while ((pid = vfork()) == -1)
pause2cannot("vfork for processor", ld->name);
if (!pid) {
@@ -416,8 +420,7 @@ static void processorstart(struct logdir *ld)
fd = xopen("newstate", O_WRONLY|O_NDELAY|O_TRUNC|O_CREAT);
xmove_fd(fd, 5);
-// getenv("SHELL")?
- execl(DEFAULT_SHELL, DEFAULT_SHELL_SHORT_NAME, "-c", ld->processor, (char*) NULL);
+ execl(G.shell, G.shell, "-c", ld->processor, (char*) NULL);
bb_perror_msg_and_die(FATAL"can't %s processor %s", "run", ld->name);
}
ld->fnsave[26] = sv_ch; /* ...restore */