Skip site navigation (1)Skip section navigation (2)
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>

next in thread | previous in thread | raw e-mail | index | archive | help
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=3D/usr


# Data directory
PGDATA=3D"/usr/mydb"

# Who to run pg_ctl as, should be "postgres".
PGUSER=3Dpostgres

# Where to keep a log file
PGLOG=3D"$PGDATA/postgres.log"

## STOP EDITING HERE

# The path that is to be used for the script
PATH=3D/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# What to use to start up the postmaster
DAEMON=3D"$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



=D6=E8=F2=E0=F2 =ED=E0 =EF=E8=F1=EC=EE =EE=F2 Lowell Gilbert
<freebsd-questions-local@be-well.ilk.org>:

> zz_11@mail.bg writes:
>
> > Hi,
> > =A0
> > =A0It is my first fbsd 6.1.
> > =A0
> > =A0I migrate a system from fbsd 6.0 to 6.1.
> > =A0
> > =A0I have a script postgresql.sh in /usr/local/etc/rc.d.
> > =A0It is executible.
> > =A0Also it is working on 6.0 at startup.
> > =A0
> > =A0But it do not runs in fbsd 6.1.
> > =A0
> > =A0If I try /usr/local/etc/rc.d/postgresql.sh start all
> is
> > fine.
> > =A0
> > =A0I checked :
> > =A0cat /etc/defaults/rc.conf | grep local_startup
> > =A0local_startup=3D"/usr/local/etc/rc.d
> /usr/X11R6/etc/rc.d" #
> > startup script
> > dirs.
> > =A0
> > =A0It looks ok for me.
> > =A0
> > =A0Pls. help me to find the problem.
> > =A0
> > 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?
>
>




-----------------------------

=C8=E7=F0=E0=E1=EE=F2=E2=E0=ED=E5 =ED=E0 =F1=E0=E9=F2 =EF=EE =C2=E0=F8=E5 =
=E6=E5=EB=E0=ED=E8=E5 =E7=E0 300=EB=E2.
http://tophost.bg/?top=3Dwebdisign




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1153806996.2f2da6a2ac173>