On Tue, 08 Aug 2023, Paco Esteban wrote: > On Mon, 07 Aug 2023, A Tammy wrote: > > > > > On 8/7/23 13:30, Paco Esteban wrote: > > > Hi ports@, > > > > > > This is a new port for shiori: https://github.com/go-shiori/shiori > > > > > > from pkg/DESCR: > > > > > > Shiori is a simple bookmarks manager written in the Go language. > > > Intended as > > > a simple clone of Pocket. You can use it as a command line > > > application or as > > > a web application. > > > > > > I had to make a bit of a dance to make it work as a system daemon. > > > The configuration is partly done via command line arguments and > > > environment variables. In order to be able to use those, I moved the > > > binary to /usr/local/libexec and created a wrapper script that loads the > > > variables from a config file (/etc/shiori.conf) if it exists and calls > > > the actual binary (thank you semarie@ for your help there). > > > > Not aimed at shiori in particular but I wanted to talk about how we are > > loading environment variables in rcctl in general. > > > > Until now the recommended approach was to put the variables in the > > /etc/login.conf.d/<service> file (like with the step-ca port), while > > I've also seen daemons who had to write these wrapper like scripts to > > load environment variables from config files (I did the same for all > > jitsi ports). > > > > Do we want to keep this fragmented approach or try to some up with a > > different method for loading/setting these variables? > > While not the ideal model, systemd allows setting environment variables > > in its unit file or allows setting a file from which to load environment > > variables (the EnvironmentFile variable) and openrc loads variables from > > /etc/conf.d/<service-name>. > > I would prefer not to use the wrapper script to be honest. I did not > think about the login.conf(5) approach. Will change the port to use > that instead. It will probably solve the rcctl stop problem too. > > In any case, a simple config file that can be sourced is easier to > handle than the login.conf(5) syntax (I personally never liked it, but > that may be only me). > > I'm in favor of something similar to what openrc does. We could go with > something similar, predefined folder to put a file named as the service > that will be sourced before start. I can take a look at rc.subr and > start the long bikeshedding process that this will likely trigger, but I > think is worth it. > > Of course, I'm open to suggestions. > > Thanks Aisha.
Find attached the updated version that removes the wrapper script and makes use of login classes. ok to import ? -- Paco Esteban. 0x5818130B8A6DBC03
shiori_port.tar.gz
Description: application/tar-gz