>I have a oneshot that needs to perform, let's say, more complex
>operations than I'm willing to implement with execline ATM. So I want to
>call a regular shell script from the up/down files.
>
>However, since oneshots ignore the shebang I can neither change the
>interpreter, nor pass arguments to execlineb. And the working directory
>is that of the oneshot runner, so I also can't invoke the shell script
>with a relative path.
>
>It's no biggie, though. I just wanted to confirm that I need to call the
>script with absolute path.
I confirm that it's the intended usage for oneshot scripts.
In $srcdir/up, you just invoke "/path/to/your/script args...", and
"script" can be any executable you want, including a shell script.
The fact that the up and down scripts are interpreted with execline
is an implementation detail, and the fact that it's possible to
implement whole up/down scripts in those files, using execline
facilities, is a nice optimization trick, but is by no means mandatory;
the idea was always to have an independent script repository à la
/etc/init.d to host your oneshots, and call scripts in there via their
absolute paths from up/down.
--
Laurent
Received on Fri Oct 16 2020 - 16:12:42 UTC