John Bright wrote:
>
> Oliver,
> I tried your script.
> I get the weirdest thing happening.
> I added it as a file called postgres to the directory /sbin/init.d.
> I created the two symbolic links in the subdirectory
> as ln -s ../postgres S86postgres and K05postgres.
> When I to run the script by typing
> /sbin/init.d/postgres start, the script bombs out saying
> No such file or directory.
> I know the script will work because if I type
> su - postgres -c "...etc .....etc " it brings up the postmaster
> for me, and killproc similarly typed at the command line
> shuts down the postmaster.
> Have you got any ideas ?
> Weird city or what ?
> Regards
> John
oh,
probably a matter of my mail prog wrapping "long" lines before sending.
i turned this feature explicitly off and pasted the script again:
----------------------------------------------------------------------
#! /bin/sh
#
# postgres.init Start postgres back end system.
#
# Author: Thomas Lockhart <Thomas.Lockhart@jpl.nasa.gov>
# based on news startup by David Myers
#
# Modified by Daniele Arduini:
# - support for bash shell
# - /usr/local/pgsql installation
#
# Assumptions:
# - the postgres user is named "postgres"
# - the postgres user is running bash
# - /etc/syslog.conf contains the line "local5.* -/var/log/postgres"
[ -f /usr/local/pgsql/bin/postmaster ] || exit 0
# See how we were called.
case "$1" in
start)
echo -n "Starting postgresql service: "
# force full login to get path names and environment variables
# postgres runs bash so use proper syntax in redirection
# change this line if the postgres superuser account is not "postgres"
# change this line if another shell syntax is necessary
su postgres -c 'nohup /usr/local/pgsql/bin/postmaster -i -B 256 \
-D/usr/local/pgsql/data 2>&1 | logger -p local5.notice &'
sleep 2
pid=`pidof postmaster`
echo -n "postmaster [$pid]"
touch /var/lock/subsys/postmaster
echo
;;
stop)
echo -n "Stopping postgresql service: "
killproc /usr/local/pgsql/bin/postmaster
sleep 2
rm -f /var/lock/subsys/postmaster
echo
;;
*)
echo "Usage: postgres.init {start|stop}"
exit 1
esac
exit 0
---------------------------------------------------------------------------
any better this time?
just curious: did you get answers for your perl questions?
oliver