summaryrefslogtreecommitdiff
blob: 7014e79e5eb073ff2c1dd35fc02515bdb46e463a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/sbin/runscript
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /var/cvsroot/gentoo-x86/dev-db/postgresql/files/pg_autovacuum.init-7.4.1,v 1.1 2003/12/25 04:39:37 nakano Exp $

depend() {
	need postgresql logger
}

start()	{
	ebegin "Starting pg_autovacuum"
	start-stop-daemon --chuid $PGUSER --start --quiet --exec /usr/bin/pg_autovacuum -- -D -v $VACUUM_BASE -V $VACUUM_SCALE -s $SLEEP_BASE -S $SLEEP_SCALE -L $PG_AUTOVACUUM_LOG
	sleep 1
	pidof /usr/bin/pg_autovacuum > /dev/null
	if [ $? -eq 0 ]; then
		eend 0
	else
		eerror "Please see log file: $PG_AUTOVACUUM_LOG"
		eerror "You may need to add following lines in /var/lib/postgresql/data/postgresql.conf and restart PostgreSQL."
		eerror " stats_start_collector = true"
		eerror " stats_row_level = true"

		eerror "Please read /usr/share/doc/postgresql-7.4.1/contrib/README.pg_autovacuum for details."
		eend 1
	fi
}

stop ()	{
	ebegin "Stopping pg_autovacuum"
	start-stop-daemon --stop --quiet --exec /usr/bin/pg_autovacuum
	result=$?
	eend $result
}