pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedStart-up script for Solaris
5+ messages / 3 participants
[nested] [flat]
* Start-up script for Solaris
@ 2006-08-08 11:27 mcelroy, tim <tim.mcelroy@bostonstock.com>
0 siblings, 1 reply; 5+ messages in thread
From: mcelroy, tim @ 2006-08-08 11:27 UTC (permalink / raw)
To: pgsql-admin
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.
Thanks,
Tim
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Start-up script for Solaris
@ 2006-08-08 11:53 Thomas Mack <mack@ifis.cs.tu-bs.de>
parent: mcelroy, tim <tim.mcelroy@bostonstock.com>
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Mack @ 2006-08-08 11:53 UTC (permalink / raw)
To: pgsql-admin
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
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Start-up script for Solaris
@ 2006-08-08 12:19 mcelroy, tim <tim.mcelroy@bostonstock.com>
0 siblings, 1 reply; 5+ messages in thread
From: mcelroy, tim @ 2006-08-08 12:19 UTC (permalink / raw)
To: Thomas Mack <mack@ifis.cs.tu-bs.de>; 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@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Thomas Mack
Sent: Tuesday, August 08, 2006 7:54 AM
To: 'pgsql-admin@postgresql.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
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Start-up script for Solaris
@ 2006-08-08 17:04 Jim Nasby <jnasby@pervasive.com>
parent: mcelroy, tim <tim.mcelroy@bostonstock.com>
0 siblings, 0 replies; 5+ messages in thread
From: Jim Nasby @ 2006-08-08 17:04 UTC (permalink / raw)
To: mcelroy, tim <tim.mcelroy@bostonstock.com>; +Cc: Thomas Mack <mack@ifis.cs.tu-bs.de>; pgsql-admin
On Aug 8, 2006, at 7:19 AM, mcelroy, tim wrote:
> 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.
You need to upgrade. You're exposing yourself to at least one data
corruption bug and a security hole. You can go to 8.0.8 without a
dump and restore (though if you have the time it'll be worth it going
to 8.1.4).
As for startup, see if you can find someone running Solaris 10 and
grab the startup out of there (I'm assuming 9 and 10 use the same
system startup scripts...). If Sun has a web interface to their
repository, you could probably just grab that one script, too.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Start-up script for Solaris
@ 2006-08-09 13:43 mcelroy, tim <tim.mcelroy@bostonstock.com>
0 siblings, 0 replies; 5+ messages in thread
From: mcelroy, tim @ 2006-08-09 13:43 UTC (permalink / raw)
To: Jim Nasby <jnasby@pervasive.com>; +Cc: Thomas Mack <mack@ifis.cs.tu-bs.de>; pgsql-admin
Thanks Jim, good to hear from you again.
Well for starters, if anyone out there does have a Solaris 9 or 10 startup
script that they could post it would be appreciated. I will check on the
Sun site as well, if I find anything I'll post it to the list.
One of the problems may be that the Solaris install defaults to
/usr/local/pgsql and to keep consistency with my numerous Linux installs I
moved everything to /var/lib/pgsql. Maybe that caused some quirks? I did
find that once installed starting postgres with pg_ctl -D
/var/lib/pgsql/data (even in the background using the &) postgres would not
write to the logfile as outlined in my postgresql.conf file, frustrating. I
then dropped the databases, did the initdb again and used
postmaster -D /var/lib/pgsql/data & and that worked. I am at a loss as to
why but as long as it works I will not question it. I do however prefer the
/etc/init.d/postgresql script so will keep searching.
Yes, I know I need to upgrade to at least 8.0.8 (even better to 8.1) but my
hands are tied as the app that runs on the box is "not certified" against
anything higher than 8.0.1, I keep trying to push the vendor but as of yet
to no avail.
Thanks again to Thomas and Jim for your replies.
Tim
-----Original Message-----
From: Jim Nasby [mailto:jnasby@pervasive.com]
Sent: Tuesday, August 08, 2006 1:05 PM
To: mcelroy, tim
Cc: 'Thomas Mack'; 'pgsql-admin@postgresql.org'
Subject: Re: [ADMIN] Start-up script for Solaris
On Aug 8, 2006, at 7:19 AM, mcelroy, tim wrote:
> 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.
You need to upgrade. You're exposing yourself to at least one data
corruption bug and a security hole. You can go to 8.0.8 without a
dump and restore (though if you have the time it'll be worth it going
to 8.1.4).
As for startup, see if you can find someone running Solaris 10 and
grab the startup out of there (I'm assuming 9 and 10 use the same
system startup scripts...). If Sun has a web interface to their
repository, you could probably just grab that one script, too.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2006-08-09 13:43 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-08-08 11:27 Start-up script for Solaris mcelroy, tim <tim.mcelroy@bostonstock.com>
2006-08-08 11:53 ` Thomas Mack <mack@ifis.cs.tu-bs.de>
2006-08-08 12:19 Re: Start-up script for Solaris mcelroy, tim <tim.mcelroy@bostonstock.com>
2006-08-08 17:04 ` Jim Nasby <jnasby@pervasive.com>
2006-08-09 13:43 Re: Start-up script for Solaris mcelroy, tim <tim.mcelroy@bostonstock.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox