Writing software is 10% inspiration, 90% grepping through source from github trying to find how the broken internals of a third party dependency work.
It seems like a joke, like something that just couldn’t possibly be true. But in today’s world of increasingly componentized software units, we find ourselves spending a disproportionate amount of time figuring out how and why some 3rd party library works, or doesn’t work.
Thank goodness for OSS.
As it turns out this is a long-standing known issue: #97. In the issue, jarthod has a resolution which involves using a customized template to generate a working upstart configuration file. What’s non-obvious is how to incorporate this custom template.
The foreman upstart
uses three templates:
jarthod offered a replacement for
After looking through the command line options and the source for the upstart exporter, the answer was fairly easy.
process.conf.erbin any folder you like
-toption to specify a custom template directory:
foreman export upstart /etc/init -t path/to/templates/
says that the foreman exporter base
uses the method
export_template which looks for templates in 3
-t command-line provided option,
~/.foreman/templates, and finally the templates shipped with the gem
The trick is that if you look at the source for the default upstart
exporter, you might be tempted to put the templates in an
subdirectory, but templates from the
-t command-line option are looked
for just in the root of that directory.
After writing all that down, it seems STUPIDLY SIMPLE. Because it is. But yet it took longer than I wish to find and/or figure all that out. Ugh.