On 5 Aug 2017, at 10:00, Joshua Root <[email protected]> wrote:
> I don't think there is a good way to do it if the user's home directory must
> be encoded into the plist. But I suspect that is not the case, and Rainer has
> mentioned a good alternative in the ticket.
IPFS_PATH sets the path to ipfs' repo for filesystem, web hosting, p2p, cdn,
whatever you use it for, and defaults to ~/.ipfs. Since after writing the
portfile I realised that the datastore needs to be initialised before loading
the daemon anyway, I rather recreate the startup item without the env var and
put a note for the user to set it, if need be.
This should be fine (haven't tried yet)
startupitem.create yes
startupitem.executable ${prefix}/bin/${name} daemon
I assume it adds
<key>Disabled</key>
<true/>
<key>KeepAlive</key>
<true/>
but not
<key>RunAtLoad</key>
<true/>
I checked the Daemons and Services Programming Guide, but couldn't find any
info on RunAtLoad. It's not clear to me that KeepAlive implies starting after
boot.
Go is not required at runtime, I missed that and will put it in depends_build.
Re autocompletion file, is it advised, as suggested in the ticket, to copy it
to ${prefix}/share/bash-completion/completions/ipfs instead of another
directory like bash_completion.d? I don't know if bash-completion would
automatically source such file and if it's not installed it should be sourced
from rc anyway. I could use a block like docker-machine's port, although I
don't quite grasp what depends_run-append exactly does there.