On 24/09/2015 04:54, Avery Payne wrote:
1. Copy the entire contents of the svcdef/ directory into the s6 source definition directory, including dot file support directories.
There is no room in the source definition directory for a support directory as svcdef/ ; I mean, you can put it anywhere, but s6-rc-compile won't know what to do with it, and won't include it in the compiled database. If your created services need to reference things in a global support directory, the best practice is to install this support directory into an official location, and to use the absolute path to this location in your scripts. s6-rc-compile will only treat local data: if you have global data, you're in charge of it.
2. Use the install command to copy .bin, .finish, .log, and .run from the source definition directory into the compiled definition directory.
I would highly recommend NOT messing with the compiled database after it has been created. The format isn't fixed, and I want to have complete freedom to change it. The only official interface is the source format; you should do whatever is required to whip up a working source definition directory that doesn't need extra magic after the compilation phase. Once you have run s6-rc-compile, the database is opaque stuff you can't modify; you can move the compiled directory around, but don't mess with it. Also, when I said that s6-rc-compile does not dereference symlinks, I partially lied. It is true for whatever is in data/ and env/ subdirectories. But "special" scripts that make a service directory such as ./run and ./finish are definitely not copied verbatim; those links will be dereferenced. You cannot assume that your run scripts themselves are called ./run, either: in some cases, s6-rc-compile puts a wrapper around them. If you need to perform run-time magic, put all your stuff in data/ and operate there. But as much as possible, the magic should happen when you convert scripts to the s6-rc-compile source format, so the compiled database remains simple and straightforward. -- Laurent