From owner-freebsd-questions@FreeBSD.ORG Tue Jul 25 05:56:10 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 25FF116A4DF for ; Tue, 25 Jul 2006 05:56:10 +0000 (UTC) (envelope-from zz_11@mail.bg) Received: from mx3.mail.bg (mx-balancer.mail.bg [193.201.172.113]) by mx1.FreeBSD.org (Postfix) with ESMTP id 799C343D45 for ; Tue, 25 Jul 2006 05:56:09 +0000 (GMT) (envelope-from zz_11@mail.bg) Received: from localhost (web13.mail.bg [193.201.172.110]) by mx3.mail.bg (Postfix) with ESMTP id 68B25E00885; Tue, 25 Jul 2006 08:56:08 +0300 (EEST) Received: from unisoft.unisoftbg.com (unisoft.unisoftbg.com [194.12.229.193]) by mail.bg (mail.bG Webmail 4.0.1) with HTTP for ; Tue, 25 Jul 2006 08:56:36 +0300 Message-ID: <1153806996.2f2da6a2ac173@mail.bg> Date: Tue, 25 Jul 2006 08:56:36 +0300 From: zz_11@mail.bg To: freebsd-questions@freebsd.org References: <1153741158.2a48068fa8765@mail.bg> <44hd16vq5w.fsf@be-well.ilk.org> In-Reply-To: <44hd16vq5w.fsf@be-well.ilk.org> MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1251" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: mail.bG Webmail 4.0-cvs X-Originating-IP: 194.12.229.193 Cc: Lowell Gilbert Subject: Re: fbsd 6.1 and starting services problem X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jul 2006 05:56:10 -0000 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 : > 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