FreeBSD issue with release start at boot time

Hi guys,

I’m having issues when i try to start a release at boot time with the standard rc.d script on my FreeBSD server (FreeBSD 11.1-RELEASE-p1) with Elixir 1.5.2 and Erlang 20.1 . The release was built on the same machine that is running it. I am using the default rel/config.exs with distillery. The user who is generating the release has bash as its default shell, so I am a bit lost because the log at boot time is as follow:

Starting timbre…
Bash is required to run this release. Please ensure that it is installed.

and the release is not started…

The release is starting perfectly manually though

from the release bin:

==> Assembling release…
==> Building release timbre:0.0.1 using environment prod
==> Including ERTS 9.1 from /usr/local/lib/erlang20/erts-9.1
==> Packaging release…
==> Release successfully built!
You can run it in one of the following ways:
Interactive: _build/prod/rel/timbre/bin/timbre console
Foreground: _build/prod/rel/timbre/bin/timbre foreground
Daemon: _build/prod/rel/timbre/bin/timbre start

[root@phoenix /usr/local/tilikum/timbre]# _build/prod/rel/timbre/bin/timbre start
[root@phoenix /usr/local/tilikum/timbre]# _build/prod/rel/timbre/bin/timbre ping

from my startup script:

[root@phoenix ~]# /usr/local/etc/rc.d/timbre start
Starting timbre…
[root@phoenix ~]# /usr/local/etc/rc.d/timbre status
[root@phoenix ~]# /usr/local/etc/rc.d/timbre restart
Stopping timbre…
Starting timbre…
[root@phoenix ~]# /usr/local/etc/rc.d/timbre status

any idea on what I am missing?


Ok i have figured it out, Distillery uses #!/usr/bin/env bash which is not available for rc.d startup scripts…my quick & dirty fix is to add the path in my rc.d script:


release now starting perfectly at boot time