>
>Symlinking the oneshot service directory with other names,
>e.g. having a oneshot script for setting up the network
>and symlinking it for different interfaces, so that a change
>does not have to be made in all the copied scripts
>(of course its unlikely to have enough interfaces
>to justify this, but it conveys the idea).
Yeah, I thought about this too, but given the structure of up/down
scripts, it's just not worth it. If your up/down script is bigger
than a one-liner, then unless you're super proficient in execline,
you'll probably want to write your real service script somewhere
and invoke it in up. That's the recommended usage. And as soon as
you're doing that, everything that you want to factorize, you
factorize in your real service script.
For instance, your "eth0" up script could be:
/etc/networking/start-interface eth0
and your "eth1" up script would be:
/etc/networking/start-interface eth1
and all the real work is done in the start-interface script. That way,
you don't have to mess with symlinks in the up scripts, etc.
--
Laurent
Received on Mon Nov 04 2024 - 01:17:10 CET