X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 50848D1B1BD for ; Fri, 4 Jun 2004 11:51:54 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 45946-01 for ; Fri, 4 Jun 2004 14:51:51 +0000 (GMT) Received: from CISX-Linux4.cisx.com (unknown [213.133.202.58]) by svr1.postgresql.org (Postfix) with ESMTP id 5FD83D1B48C for ; Fri, 4 Jun 2004 11:51:49 -0300 (ADT) Received: from DEMOLITION ([192.168.100.22]) by CISX-Linux4.cisx.com (8.12.8/8.12.8) with SMTP id i54Ejwne026005 for ; Fri, 4 Jun 2004 15:45:58 +0100 Message-ID: <005e01c44a43$25eb2c10$1664a8c0@DEMOLITION> From: "Donald Fraser" To: "[ADMIN]" References: Subject: Re: Autovacuum option in init script Date: Fri, 4 Jun 2004 15:49:32 +0100 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_005A_01C44A4B.875C1CE0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4927.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200 X-Virus-Scanned: by amavisd-new at hub.org X-Archive-Number: 200406/38 X-Sequence-Number: 13698 This is a multi-part message in MIME format. ------=_NextPart_000_005A_01C44A4B.875C1CE0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_005B_01C44A4B.875E8DE0" ------=_NextPart_001_005B_01C44A4B.875E8DE0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Attached is a script I created to run on Redhat. Someone might find it useful. It's not a big deal to make it run as the next script after postgresql. Regards Donald Fraser ----- Original Message -----=20 From: Roy Walker=20 To: pgsql-admin@postgresql.org=20 Sent: Wednesday, June 02, 2004 9:58 PM Subject: [ADMIN] Autovacuum option in init script I am sure someone else has mentioned this, but adding an option in the in= it script for the next Postgres release to start pg_autovacuum with Postgre= s. =20=20=20 I understand some people (don't know who, but I am sure they are out ther= e) would rather use cron scripts, so making it an option that is initially = disabled would be a good idea. =20=20=20 Roy ------=_NextPart_001_005B_01C44A4B.875E8DE0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Attached is a script I created to run on= =20 Redhat.
Someone might find it useful.
It's not a big deal to make it run as the = next=20 script after postgresql.
 
Regards
Donald Fraser
 
----- Original Message -----
Fro= m:=20 Roy Walker
Sent: Wednesday, June 02, 2004 9:5= 8=20 PM
Subject: [ADMIN] Autovacuum option= in=20 init script

I am sure someone else has= =20 mentioned this, but adding an option in the init script for the next Postgres release to start pg_autovacuum with Postgres.

 

I understand some people (d= on’t=20 know who, but I am sure they are out there) would rather use cron scripts, so making it an option that is initia= lly=20 disabled would be a good idea.

 

Roy

------=_NextPart_001_005B_01C44A4B.875E8DE0-- ------=_NextPart_000_005A_01C44A4B.875C1CE0 Content-Type: application/octet-stream; name="pg_autovacuum" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="pg_autovacuum" #!/bin/sh # pg_autovacuum: Starts and stops the PostgreSQL autovacuum daemon # chkconfig: - 86 05 # description: Starts and stops the PostgreSQL autovacuum daemon # processname: pg_autovacuum # pidfile: /var/lib/pgsql/data/pg_autovacuum.pid # Source function library. . /etc/rc.d/init.d/functions RETVAL=3D0 start(){ echo -n $"Starting pg_autovacuum :" # Check if already running... pid=3D`pidof -s pg_autovacuum` if [ $pid ] then echo " [ PID: $pid ]" else su -l postgres -c "pg_autovacuum -D -U postgres > /dev/null 2>&1"& RETVAL=3D$? if [ $RETVAL -lt 1 ] then pid=3D`pidof -s pg_autovacuum` echo "$pid" > /var/lib/pgsql/data/pg_autovacuum.pid echo_success else echo_failure fi echo fi } stop(){ echo -n $"Stopping pg_autovacuum :" pid=3D`pidof -s pg_autovacuum` if [ $pid ] then pid=3D${pid:0:6} kill -SIGTERM $(($pid)) RETVAL=3D$? if [ $RETVAL -lt 1 ]; then echo_success rm -f /var/lib/pgsql/data/pg_autovacuum.pid else echo_failure fi echo else echo " [ NOT RUNNING ]" rm -f /var/lib/pgsql/data/pg_autovacuum.pid fi } restart(){ stop start } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) restart ;; reload) restart ;; *) echo $"Usage: $0 {start|stop|restart|reload}" exit 1 esac exit $RETVAL ------=_NextPart_000_005A_01C44A4B.875C1CE0--