Dan Ritter:
Eventually we'll have to do the work, but the operations staff here has a consensus that if we're going to do the work, we might as well go to a system that we feel capable of understanding and trusting, something more like daemontools. Nosh is being considered.
Having thought about this, I'd do things this way:
You need two new extensions Tuttle:noshService and Tuttle::noshSocket. Both work by having INI files in your master configuration area, and they generate the actual service bundles on the slave systems from those.
Tuttle:noshService ...
nosh-service
./var/local/sv/
system-control convert-systemd-units --local-bundle --no-systemd-quirks --bundle-root /var/local/sv/ -- /var/local/sv/${wibble}.service
system-control convert-systemd-units --local-bundle --no-systemd-quirks --bundle-root /var/local/sv/ -- /var/local/sv/cyclog@${wibble}.service
/var/local/sv/${wibble}/log
to ../cyclog@${wibble}
system-control enable -- cyclog@${wibble}.service ${wibble}.service
system-control start --verbose -- cyclog@${wibble}.service ${wibble}.service
system-control disable -- cyclog@${wibble}.service ${wibble}.service
system-control stop --verbose -- cyclog@${wibble}.service ${wibble}.service
system-control unload_when_stopped -- cyclog@${wibble}.service ${wibble}.service
/var/local/sv/
/var/local/sv/${wibble}/
and at /var/local/sv/cyclog@${wibble}/
Tuttle:noshSocket ...
nosh-socket
./var/local/sv/
system-control convert-systemd-units --local-bundle --no-systemd-quirks --bundle-root /var/local/sv/ -- /var/local/sv/${wibble}.socket
system-control convert-systemd-units --local-bundle --no-systemd-quirks --bundle-root /var/local/sv/ -- /var/local/sv/cyclog@${wibble}.service
/var/local/sv/${wibble}/log
to ../cyclog@${wibble}
system-control enable -- cyclog@${wibble}.service ${wibble}.socket
system-control start --verbose -- cyclog@${wibble}.service ${wibble}.socket
system-control disable -- cyclog@${wibble}.service ${wibble}.socket
system-control stop --verbose -- cyclog@${wibble}.service ${wibble}.socket
system-control unload-when-stopped -- cyclog@${wibble}.service ${wibble}.socket
/var/local/sv/
/var/local/sv/${wibble}/
and at /var/local/sv/cyclog@${wibble}/
I've not complicated the aforegiven by including all of the ${tuttle:id}s and where they would be inserted into the file and directory names (just before ${wibble}, usually), on the presumption that you know all about that.
Then the INI files that you write for (say, HTTP being already taken in your examples) nosh-socket gopherd
would look like:
; gopherd@.service
[Unit]
Description=GOPHER service over IP4/IP6 using djbwares' gopherd
Description=http://jdebp.eu./Softwares/djbwares/
[Service]
EnvironmentDirectory=env
EnvironmentUser=%p-d
LimitNOFILE=20
LimitDATA=5000000
ExecStart=${localhost:+setenv ${PROTO:-TCP}LOCALHOST "${localhost}"} %p ${root:-/home/publicfile/public}
[Install]
WantedBy=server.target
; gopherd.socket
[Unit]
Description=GOPHER socket capable of single-stack IPV6 and IPV6-mapped IPV4
[Socket]
Backlog=2
ListenStream=gopher
Accept=true
MaxConnections=16
UCSPIRules=false
LogUCSPIRules=yes
NoDelay=false
BindIPv6Only=both
Setting up cyclog@.service, so that the generated /var/local/sv/cyclog@${wibble}
runs cyclog
as user ${wibble}-l logging to /var/log/${wibble}
, is an exercise in more of the same that you only need to write once:
[Unit]
Description=Standard format %p logging service for %I
Before=%I
[Service]
WorkingDirectory=/var/log/
User=%i-l
ExecStart=%p %I/
[Install]
WantedBy=workstation.target