forked from Lainports/freebsd-ports
Repo copy from databases/pgpool-II. Changes from that port: - New port for pgpool-II33-3.3.3 - Stagify - Add libtool, gmake, pgsql, perl5 to USES. Drop .la files -- this is a new port, so there can't be any pre-existing consumers of the .la files to worry about. - Use options helpers - The configure used with this software is buggy and doesn't understand --without-foo. Just omit any --with-foo or --without-foo to turn off 'foo' support. - New options PAM MEMCACHED. Enable PAM by default since it only depends on the base system. - Add RUN_DEPENDS on rsync and perl5 -- needed for the scripts pgpool_copy_backup and pgpool_remote_start respectively. - regenerate pkg-plist using 'make makeplist.' Just use the auto-generated plist entries for %%PORTDOCS%% rather than the $PORTDOCS variable. - Simplify how docs and sql/contrib functions are installed Redports: https://redports.org/buildarchive/20140629142900-20287/ PR: 189880 Submitted by: michelle@sorbs.net Reviewed by: pi, matthew
56 lines
1.3 KiB
Bash
56 lines
1.3 KiB
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: pgpool
|
|
# REQUIRE: LOGIN
|
|
# KEYWORD: shutdown
|
|
#
|
|
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
|
|
# to enable this service:
|
|
#
|
|
# pgpool_enable (bool): Set to NO by default.
|
|
# Set it to YES to enable pgpool.
|
|
# pgpool_conf (file): Set location of your config.
|
|
# Default is "%%PREFIX%%/etc/pgpool.conf"
|
|
# pgpool_flags (string): Default is "-f $pgpool_conf"
|
|
# pgpool_looger (bool): Use logger for logging.
|
|
# pgpool_looger_pri (string): logger priority (default "local0.info").
|
|
# pgpool_user (uid): User ID to run as (default nobody)
|
|
#
|
|
|
|
. /etc/rc.subr
|
|
|
|
name=pgpool
|
|
rcvar=pgpool_enable
|
|
|
|
load_rc_config $name
|
|
|
|
: ${pgpool_enable="NO"}
|
|
: ${pgpool_conf="%%PREFIX%%/etc/pgpool.conf"}
|
|
: ${pgpool_flags="-f ${pgpool_conf}"}
|
|
: ${pgpool_user="nobody"}
|
|
: ${pgpool_logger="YES"}
|
|
: ${pgpool_logger_pri="local0.info"}
|
|
|
|
command="%%PREFIX%%/bin/pgpool"
|
|
command_args="${pgpool_flags}"
|
|
start_cmd="pgpool_start"
|
|
stop_cmd="${command} ${command_args} stop"
|
|
|
|
extra_commands="reload"
|
|
reload_cmd="${command} ${command_args} reload"
|
|
|
|
required_files="${pgpool_conf}"
|
|
|
|
pgpool_start()
|
|
{
|
|
if checkyesno pgpool_logger; then
|
|
su -m $pgpool_user -c "sh -c \"$command $command_args -n 2>&1 | logger -t $name -p $pgpool_logger_pri &\""
|
|
else
|
|
unset start_cmd
|
|
run_rc_command start
|
|
fi
|
|
}
|
|
|
|
run_rc_command "$1"
|