Allow pipe + redirect in task/run stanzas, exec() in /bin/sh

This patch extends the capabilities of task and run .conf stanzas by
enabling pipes and redirects.

Example:

    task [s] echo "foo" | cat >/tmp/bar
    run  [s] echo "$HOME" >/tmp/secret

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2017-09-04 16:00:49 +02:00
1 parent 442598282f
commit 684314db0f
4 files changed
+26 -1

No files matched your search

+3 -1
View File
@@ -270,8 +270,10 @@ static int service_start(svc_t *svc)
if (svc->inetd.cmd)
status = svc->inetd.cmd(svc->inetd.type);
else if (svc->type & SVC_TYPE_RUNTASK)
status = exec_runtask(svc->cmd, args);
else
status = execv(svc->cmd, args); /* XXX: Maybe use execve() to be able to launch scripts? */
status = execv(svc->cmd, args);
#ifdef INETD_ENABLED
if (svc_is_inetd_conn(svc)) {