freebsd-ports/security/maia/files/maiad.in
Mark Felder 7a4a6c7b2f - put the scripts in DATADIR
- proper WWWOWN and WWWGRP usage
- ETCDIR usage; config files are now in ${PREFIX}/etc/maia/
- template files are probably going to be edited by the users. Now
they're in ${ETCDIR}/templates/
- STAGE support
- MYSQLSERVER option is now: USE_MYSQL= server
- PGSQLSERVER option is now: USE_PGSQL= server
- lots of cleanup
- several installation tasks should not have been silenced (prefixed
with @)
- rc script passes rclint
- rc script handles the creation of several important directories in
start_precmd
- config files and templates are not overwritten on port upgrade if they
have been modified

PR:		ports/185452
Approved by:	swills (mentor)
2014-01-19 23:21:30 +00:00

52 lines
991 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: maiad
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable maiad:
# maiad_enable (bool): Set it to "YES" to enable maiad.
# Default is "NO".
#
. /etc/rc.subr
name=maiad
rcvar=maiad_enable
load_rc_config $name
: ${maiad_enable:=NO}
: ${maiad_pidfile="/var/run/maia/maiad.pid"}
required_files=%%ETCDIR%%/maiad.conf
start_cmd="%%PREFIX%%/sbin/maiad start"
start_precmd="start_precmd"
extra_commands="status"
pidfile=${maiad_pidfile}
procname=maiad
start_precmd()
{
for i in db tmp var virusmails; do
if [ ! -e %%MAIAHOME%%/${i} ]; then
install -d -o %%USERS%% -g %%GROUPS%% -m 750 %%MAIAHOME%%/${i}
fi
done
for i in log run lock; do
if [ ! -e /var/${i}/maia ]; then
install -d -o %%USERS%% -g %%GROUPS%% /var/${i}/maia
fi
done
# not sure why, but previous maintainer had this in the rc script
rm -rf %%MAIAHOME%%/tmp/* %%MAIAHOME%%/tmp/.* 2>/dev/null || true
}
run_rc_command "$1"