I am developing a server daemon application in Erlang using Rebar3. I plan to publish a debian package of the application at some point. I would like the experience using it be very similar to using common server software such as Nginx or Apache on Linux.
This means at least:
- Being able to configure it in /etc//config.src
- Being able to supply command line arguments to it on startup
Currently my application reads its configuration the Rebar3-way from a specific .src file at startup. It does not support command line arguments as I don’t know yet how to do it.
Is there a recommended way of packaging application to fulfill these things? How much can Rebar3 help and what parts do I need to do in .deb and/or shell scripts?
For what it’s worth, I use conf for parsing a YAML-formatted
/etc/<application>.yml. There’s other libraries for parsing TOML or whatever (though conf is nice in that it performs good configuration validation, and it integrates nicely with the standard OTP configuration mechanism).
I maintain a TURN server called eturnal, which might serve as a relatively straightforward example: It reads
/etc/eturnal.yml, I don’t think it feels much different from common server software, and I have some docs for distro packagers. I don’t care about supporting startup command line arguments (except for pointing to the configuration file), but I guess you could if you wanted to. I do support reading certain environment variables as fallback values for options not specified in the configuration file, makes Docker users happy.