Re: Start-up script for Solaris

From: "mcelroy, tim" <tim(dot)mcelroy(at)bostonstock(dot)com>
To: 'Thomas Mack' <mack(at)ifis(dot)cs(dot)tu-bs(dot)de>, "'pgsql-admin(at)postgresql(dot)org'" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Start-up script for Solaris
Date: 2006-08-08 12:19:10
Message-ID: 9765373733A7DF4681B12225D2FC44058E2D0E@bosexprod001.bostonstock.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Thank you Thomas. I've tried it but get a few syntax errors. I have
postgresql 8.0.1 installed and have moved it to /var/lib/pgsql to mimic
Linux so I need to edit the file some more. I'll let you know how it works.

Thanks,
Tim

-----Original Message-----
From: pgsql-admin-owner(at)postgresql(dot)org
[mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of Thomas Mack
Sent: Tuesday, August 08, 2006 7:54 AM
To: 'pgsql-admin(at)postgresql(dot)org'
Subject: Re: [ADMIN] Start-up script for Solaris

Am Dienstag, 8. August 2006 13:27 schrieb mcelroy, tim:
> Good morning,
>
> Curious if anyone out there has a start-up script for Solaris? A
> version of the Linux /etc/init.d/postgresql one. I recently installed
> postgres on a Solaris 9 box and although I can start up postgres it
> fails to log to the log file as directed and just "doesn't look right",
> like it does on Linux.
>
I have a rather old one, which originally started and stopped a 6.5.2
postgres on Solaris 5.6 . Now it does its job on 7.4 and Solaris 10.

Thomas Mack

=====================================================================
#!/bin/sh

killproc() { # kill the named process(es)
pid=`/usr/bin/ps -e -o pid,args | \
/usr/bin/grep "$1\>" | \
/usr/bin/grep -v "$0\>" | \
/usr/bin/grep -v grep | \
/usr/bin/awk '{print $1}'`
[ "$pid" != "" ] && kill -s INT $pid
[ "$pid" != "" ] && sleep 2
[ "$pid" != "" ] && kill -s QUIT $pid
}

#
# Start/stop postgres
#

case "$1" in

'start')
echo "Starting postgres74..."
killproc postmaster
/usr/bin/rm -f /usr/local/pgsql/data/postmaster.pid
su - postgres -c "source /usr/local/pgsql/.tcshrc; limit descriptors
512; cd /usr/local/pgsql/bin; ./postmaster -i -p 6007 -o -e >>& server.log&"
;;

'stop')
killproc postmaster # kill postmaster process
/usr/bin/rm -f /tmp/.s.PGSQL.6007
;;

'restart')
$0 stop
sleep 1
$0 start
;;

*)
echo "Usage: /etc/init.d/postgres74 { start | stop | restart }"
;;
esac

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Mr. Dan 2006-08-08 13:59:06 uninterruptible sleep
Previous Message Thomas Mack 2006-08-08 11:53:57 Re: Start-up script for Solaris