Date: Tue, 25 Jul 2006 08:56:36 +0300 From: zz_11@mail.bg To: freebsd-questions@freebsd.org Cc: Lowell Gilbert <freebsd-questions-local@be-well.ilk.org> Subject: Re: fbsd 6.1 and starting services problem Message-ID: <1153806996.2f2da6a2ac173@mail.bg> In-Reply-To: <44hd16vq5w.fsf@be-well.ilk.org> References: <1153741158.2a48068fa8765@mail.bg> <44hd16vq5w.fsf@be-well.ilk.org>
index | next in thread | previous in thread | raw e-mail
Thanks for the answer.
I think I do not need to use mergemaster.
It is a brand new install of FreeBSD 6.1.
I only copy all my scripts from /usr/local/etc/rc.d/.
For example the postgresql install is NOT from ports.
I instaaled it from source ( I did it many times on 5.1, 5.4
and 6.0 ).
I expect that all scripts in /usr/local/etc/rc.d/ will be
run on system start.
After login as root if I try to execute
/usr/local/etc/rc.d/postgres.sh start, all is working
perfect.
But I need it to start after system start alone.
Here is my script:
# ls -l /usr/local/etc/rc.d/postgres.sh
-rwxr-xr-x 1 root wheel 1327 Jul 24 21:25
/usr/local/etc/rc.d/postgres.sh
#! /bin/sh
# PostgreSQL boot time startup script for FreeBSD. Copy
this file to
# /usr/local/etc/rc.d/postgresql.
# Created through merger of the Linux start script by Ryan
Kirkpatrick
# and the script in the FreeBSD ports collection.
# $Header:
/cvsroot/pgsql-server/contrib/start-scripts/freebsd,v 1.2
2001/04/19 19:17:44 petere Exp $
## EDIT FROM HERE
# PROVIDE: postgresql
# Installation prefix
prefix=/usr
# Data directory
PGDATA="/usr/mydb"
# Who to run pg_ctl as, should be "postgres".
PGUSER=postgres
# Where to keep a log file
PGLOG="$PGDATA/postgres.log"
## STOP EDITING HERE
# The path that is to be used for the script
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# What to use to start up the postmaster
DAEMON="$prefix/bin/pg_ctl"
test -x "$DAEMON" || exit 0
case $1 in
start)
su -l $PGUSER -c "$DAEMON start -D '$PGDATA' -s -l
$PGLOG"
echo -n ' postgresql'
;;
stop)
su -l $PGUSER -c "$DAEMON stop -D '$PGDATA' -s -m
fast"
;;
restart)
su -l $PGUSER -c "$DAEMON restart -D '$PGDATA' -s -m
fast"
;;
status)
su -l $PGUSER -c "$DAEMON status -D '$PGDATA'"
;;
*)
# Print help
echo "Usage: Basename $0
{start|stop|restart|status}" 1>&2
exit 1
;;
esac
exit 0
Öèòàò íà ïèñìî îò Lowell Gilbert
<freebsd-questions-local@be-well.ilk.org>:
> zz_11@mail.bg writes:
>
> > Hi,
> >
> > It is my first fbsd 6.1.
> >
> > I migrate a system from fbsd 6.0 to 6.1.
> >
> > I have a script postgresql.sh in /usr/local/etc/rc.d.
> > It is executible.
> > Also it is working on 6.0 at startup.
> >
> > But it do not runs in fbsd 6.1.
> >
> > If I try /usr/local/etc/rc.d/postgresql.sh start all
> is
> > fine.
> >
> > I checked :
> > cat /etc/defaults/rc.conf | grep local_startup
> > local_startup="/usr/local/etc/rc.d
> /usr/X11R6/etc/rc.d" #
> > startup script
> > dirs.
> >
> > It looks ok for me.
> >
> > Pls. help me to find the problem.
> >
> > Also fbsd do not start at boot any services with
> scripts
> > in /usr/local/etc/rc.d .
>
> Did you remember to use mergemaster(8) to update your
> /etc scripts?
>
>
-----------------------------
Èçðàáîòâàíå íà ñàéò ïî Âàøå æåëàíèå çà 300ëâ.
http://tophost.bg/?top=webdisign
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1153806996.2f2da6a2ac173>
