aboutsummaryrefslogtreecommitdiff
path: root/www/mattermost-server/files/mattermostd.in
diff options
context:
space:
mode:
authorOlivier Cochard <olivier@FreeBSD.org>2018-02-02 08:50:34 +0000
committerOlivier Cochard <olivier@FreeBSD.org>2018-02-02 08:50:34 +0000
commit3328ab2963f2ec6e4a1d65a0bc0c056721474d32 (patch)
treee42cd37052497621abfdba2354c5b07d6dd9a03c /www/mattermost-server/files/mattermostd.in
parent70b904a53ca645313c23239057275db3afbe613d (diff)
Notes
Diffstat (limited to 'www/mattermost-server/files/mattermostd.in')
-rw-r--r--www/mattermost-server/files/mattermostd.in56
1 files changed, 56 insertions, 0 deletions
diff --git a/www/mattermost-server/files/mattermostd.in b/www/mattermost-server/files/mattermostd.in
new file mode 100644
index 000000000000..c44596423fd0
--- /dev/null
+++ b/www/mattermost-server/files/mattermostd.in
@@ -0,0 +1,56 @@
+#!/bin/sh
+# $FreeBSD$
+
+# PROVIDE: mattermostd
+# REQUIRE: DAEMON NETWORKING
+# BEFORE: LOGIN
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable mattermostdb:
+# mattermostd_enable="YES"
+#
+# mattermostd_enable (bool): Set to YES to enable influxd
+# Default: NO
+# mattermostd_conf (str): influxd configuration file
+# Default: ${PREFIX}/etc/mattermostd.conf
+# mattermostd_user (str): influxd daemon user
+# Default: mattermostd
+# mattermostd_group (str): influxd daemon group
+# Default: mattermostd
+# mattermostd_flags (str): Extra flags passed to influxd
+#
+# mattermostd_facility (str): Syslog facility to use
+# Default: daemon
+# mattermostd_priority (str): Syslog priority to use
+# Default: info
+
+. /etc/rc.subr
+
+name="mattermostd"
+rcvar=mattermostd_enable
+load_rc_config $name
+
+: ${mattermostd_enable:="NO"}
+: ${mattermostd_user:="mattermost"}
+: ${mattermostd_group:="mattermost"}
+: ${mattermostd_flags:="--disableconfigwatch"}
+: ${mattermostd_facility:="daemon"}
+: ${mattermostd_priority:="info"}
+: ${mattermostd_conf:="%%PREFIX%%/etc/mattermost/config.json"}
+: ${mattermostd_options:="${mattermostd_flags} --config=${mattermostd_conf}"}
+
+# daemon
+mattermostd_pidfile="/var/run/${name}.pid"
+procname="%%PREFIX%%/bin/${name}"
+command=/usr/sbin/daemon
+start_cmd="mattermostd_startcmd_daemon"
+
+mattermostd_startcmd_daemon()
+{
+ echo "Starting ${name}."
+ cd /usr/local/www/mattermost && \
+ /usr/sbin/daemon -p ${mattermostd_pidfile} -S -s ${mattermostd_priority} -l ${mattermostd_facility} \
+ -u ${mattermostd_user} ${procname} ${mattermostd_options}
+}
+
+run_rc_command "$1"