Skip to content

Commit

Permalink
Load environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
patmaddox committed May 18, 2022
1 parent 78fb8a7 commit 57bb0f2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ end

Run them using [`service(8)`](https://www.freebsd.org/cgi/man.cgi?service(8)).

After installing the package, you should define application-specific environment variables in `/usr/local/etc/<appname>.conf`.

## Roadmap

- configure log / tmp / var files
Expand Down
12 changes: 8 additions & 4 deletions priv/templates/freebsd.gen.pkg/rc.eex
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@

. /etc/rc.subr

name="<%= @pkg_name %>"
rcvar="<%= @pkg_name %>_enable"
name=<%= @pkg_name %>
rcvar=<%= @pkg_name %>_enable
load_rc_config <%= @pkg_name %>

: ${<%= @pkg_name %>_env_file:=<%= FreeBSD.pkg_prefix() %>/etc/<%= @pkg_name %>.conf}

command="<%= FreeBSD.pkg_prefix() %>/bin/<%= @pkg_name %>"
extra_commands="pid remote"

start_cmd="${command} daemon"
stop_cmd="${command} stop"
restart_cmd="${command} restart"
pid_cmd="${command} pid"
status_cmd="<%= @pkg_name %>_status"
remote_cmd="<%= @pkg_name %>_remote"
status_cmd=<%= @pkg_name %>_status
remote_cmd=<%= @pkg_name %>_remote

_check_running()
{
Expand Down

0 comments on commit 57bb0f2

Please sign in to comment.