From owner-freebsd-questions@FreeBSD.ORG Thu Jun 16 19:47:48 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60DF91065673 for ; Thu, 16 Jun 2011 19:47:48 +0000 (UTC) (envelope-from freebsd-questions@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id E05438FC18 for ; Thu, 16 Jun 2011 19:47:47 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QXIXZ-0003eL-VK for freebsd-questions@freebsd.org; Thu, 16 Jun 2011 21:47:45 +0200 Received: from pool-173-79-85-36.washdc.fios.verizon.net ([173.79.85.36]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 16 Jun 2011 21:47:45 +0200 Received: from nightrecon by pool-173-79-85-36.washdc.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 16 Jun 2011 21:47:45 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-questions@freebsd.org From: Michael Powell Followup-To: gmane.os.freebsd.questions Date: Thu, 16 Jun 2011 15:48:10 -0400 Lines: 85 Message-ID: References: <8F88EB66-BE96-4465-82CF-AAED40B81458@forestinformatics.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: pool-173-79-85-36.washdc.fios.verizon.net Subject: Re: startup postgresql 9.0.3 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: Thu, 16 Jun 2011 19:47:48 -0000 Jeff Hamann wrote: > I've installed and tested postgresql just fine on FreeBSD 8.2. > > I've been trying to get postgresql (the server) to start on bootup using > /etc/rc.conf system. Sometime quite a while back FreeBSD imported the rc.subr startup subsystem from NetBSD. > I'm using the script from the tarball (found in the > contrib/start-scripts/freebsd of postreges tarball) This script is not in rc.subr format, looks a tad "Linuxy" at first glance. > I can't seem to get it to work on FreeBSD 8.2 amd64 (I don't think the > arch is important here, but you never know). > > As instructed in the script, I've moved the file to > /usr/local/etc/rc.d/postgresql This is definitely the right location. There are some instructions on a couple of other things to look at first in the ports build output. These can be examined in the port directory for clues. > I've added the "postgresql_enable=YES" to /etc/rc/conf. As a non rc.subr script it will never pick up this variable. > I know I'm missing some magic here > (http://www.freebsd.org/doc/en_US.ISO8859-1/articles/rc- scripting/index.html > perhaps?) > > I've /usr/local/pgsql/bin./postgres --help'd too and can't seem to get > traction. If everything else seems OK, like you can start it without the script and all you need to do is convert the script over so it will start with boot, look over the port patchset and some of the other startup scripts. It's not too difficult once you see how the other rc.subr scripts are put together. I thought a sysvinit script would still work as a fallback as long as it was marked executable, and perhaps with a .sh at the end. I remember needing the .sh for a while and discovering they were supposed to work anyway without it. Upon investigation that turned out to be something I missed/ignored with mergemaster during a system update. Maybe this has fallen by the wayside. > Can you please help? I'm sure this is something simple I'm neglecting. I'm pretty "simple" myself. If I can install it with the ports system where all the hard stuff has been handled for me by people smarter than me, well, that's a no-brainer. :-) > Please don't respond with "Why don't you just use the ports collection?" My first inclination. Postgresql is a fairly complicated thing and using the ports to install it "makes it go". Too many other pressing issues... > There's reasons - like: > 1) need to build from source Uhmmm - ports build from source. > 3) it's for a tutorial - non-sequitur > 3) postgresql90-server isn't building. I would be more concerned by this. I just went to the postgresql90-server port and it built just fine. If it isn't for you it indicates other problems with your system. Another thing you'll find eventually, that when you don't use the ports system maintenance will soon become a nightmare. As a sysadmin I make it a point to not shoot myself in the foot. Building stuff from tarballs is for the birds from a sysadmins point of view. It's called: "Ready! Fire! Aim!" -Mike