Thanks Eric, but maybe that's only the case when using default execline as @ shebang "executor shell"?
Here's the 66-inservice output (redacted) of the local-iptables service copied to /etc/66/service/iptables:
Start script : if { 66-yeller -cdp local-iptables -1 /dev/console starts... }
if -nt {
execl-toc -e ${script_conf}
iptables-restore ${script_conf}
}
66-yeller -fcdp local-iptables -1 /dev/console crashed!
Stop script : exec 2>&1
66-yeller -cdp local-iptables -1 /dev/console stops...
if ! type -p iptables &>/dev/null; then
66-yeller -fcdp local-iptables -1 /dev/console "unable to find iptables program"
fi
while read -r table; do
tables+=("/usr/share/iptables/empty-$table.rules")
done <"/proc/net/ip_tables_names"
if (( ${# tables[*]} )); then
cat "${tables[@ ]}" | iptables-restore
fi
Then, 66-enable && 66-start works as expected but a 66-stop -v 4 iptables gives:
66-stop(src/lib66/ssexec_stop.c: ssexec_stop(): 236): tracing: stop atomic services ...
s6-rc: info: bringing selected services down
s6-rc: info: service iptables: stopping
s6-ipcclient: connected to /run/66/tree/0/root/servicedirs/s6rc-oneshot-runner/s
local-iptables: info: stops...
to: -c: line 6: syntax error: unexpected end of file
s6-rc: warning: unable to stop service iptables: command exited 2
66-stop(src/lib66/ssexec_dbctl.c: ssexec_dbctl(): 349): fatal: unable to stop services selection
When doing this with a -escaped shell body for [stop]'s @ execute=(...) block, like this (redacted)
Start script : if { 66-yeller -cdp local-iptables -1 /dev/console starts... }
if -nt {
execl-toc -e ${script_conf}
iptables-restore ${script_conf}
}
66-yeller -fcdp local-iptables -1 /dev/console crashed!
Stop script :
exec 2>&1
66-yeller -cdp local-iptables -1 /dev/console stops...
if ! type -p iptables &>/dev/null; then
66-yeller -fcdp local-iptables -1 /dev/console \"unable to find iptables\"
fi
while read -r table; do
tables+=(\"/usr/share/iptables/empty-$table.rules\")
done <\"/proc/net/ip_tables_names\"
if (( ${# tables[*]} )); then
cat \"${tables[@ ]}\" | iptables-restore
fi
I do not get the error
to: -c: line 6: syntax error: unexpected end of file
This lead me to think that I need to -escape the bash block.
Am I doing something (very) wrong here?