mirror of
https://git.freebsd.org/ports.git
synced 2025-07-04 02:49:14 -04:00
- update spread4 to 4.2.0 - the port has a dedicated user/group, so use them in the rc script (instead root) - use dedicated log directory - assign port to ports@ devel/pecl-spread - bump PORTREVISION PR: 175510 Submitted by: Javier Martin Rueda <jmrueda@diatel.upm.es>
47 lines
929 B
Bash
47 lines
929 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: spread
|
|
# REQUIRE: LOGIN
|
|
# KEYWORD: shutdown
|
|
|
|
#
|
|
# Add the following lines to /etc/rc.conf to enable spread:
|
|
#
|
|
# spread_enable="YES"
|
|
# spread_flags="<set as needed>"
|
|
#
|
|
# See spread(1) for flags
|
|
|
|
. /etc/rc.subr
|
|
|
|
name=spread
|
|
rcvar=spread_enable
|
|
load_rc_config ${name}
|
|
|
|
# set defaults
|
|
spread_enable=${spread_enable:-"NO"}
|
|
spread_user=%%USERS%%
|
|
spread_group=%%GROUPS%%
|
|
|
|
command="%%PREFIX%%/sbin/spread"
|
|
required_files=%%PREFIX%%/etc/${name}.conf
|
|
pidfile=/var/run/${name}.pid
|
|
|
|
start_cmd=spread_start
|
|
stop_postcmd=spread_cleanup
|
|
|
|
spread_start() {
|
|
echo "Starting spread."
|
|
/usr/bin/install -o ${spread_user} -g ${spread_group} -d /var/log/spread
|
|
/usr/bin/touch ${pidfile} && /usr/sbin/chown ${spread_user}:${spread_group} ${pidfile}
|
|
/usr/sbin/daemon -cf -p ${pidfile} -u ${spread_user} ${command} ${spread_flags}
|
|
}
|
|
|
|
spread_cleanup() {
|
|
[ -f ${pidfile} ] && rm -f ${pidfile}
|
|
}
|
|
|
|
run_rc_command "$1"
|