From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1R5N0W-0005nJ-Me for garchives@archives.gentoo.org; Sun, 18 Sep 2011 19:26:28 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 271C721C024; Sun, 18 Sep 2011 19:26:21 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id D683321C024 for ; Sun, 18 Sep 2011 19:26:20 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 57EDC1B4028 for ; Sun, 18 Sep 2011 19:26:20 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 6332C80042 for ; Sun, 18 Sep 2011 19:26:19 +0000 (UTC) From: "Aaron Swenson" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Aaron Swenson" Message-ID: Subject: [gentoo-commits] proj/pgsql-patches:initscripts commit in: / X-VCS-Repository: proj/pgsql-patches X-VCS-Files: README postgresql.init X-VCS-Directories: / X-VCS-Committer: titanofold X-VCS-Committer-Name: Aaron Swenson X-VCS-Revision: d522eeff49e2c428b9873e640e3a779a5bbf7731 Date: Sun, 18 Sep 2011 19:26:19 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 178e22e70743505029aa54b9ea608c6e commit: d522eeff49e2c428b9873e640e3a779a5bbf7731 Author: Aaron W. Swenson gentoo org> AuthorDate: Sun Sep 18 19:25:41 2011 +0000 Commit: Aaron Swenson gentoo org> CommitDate: Sun Sep 18 19:25:41 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/pgsql-patches= .git;a=3Dcommit;h=3Dd522eeff Added {,/var}/run creation and updated README to match up with these file= s. --- README | 30 +++++++++++++----------------- postgresql.init | 14 ++++++++++++-- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/README b/README index 91a55f0..42cd086 100644 --- a/README +++ b/README @@ -1,22 +1,18 @@ -This repository is split into three primary branches. +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +Initscripts +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 -Patches -------------------------------------------------------------------------= ------- -The 'patches' branch is further split to match the major versions -versions (a.k.a., slots). Pay attention to the tags as the signify the h= ighest -version they work with. +postgresql.confd and postgresql.init have been written to condense the n= umber of +files that are necessary for maintenance. The dev-db/postgresql-server e= builds +sed the files replacing @SLOT@ with the proper slot number and @RUN@ wit= h either +/run or /var/run, depending on if /run exists. =20 -Those files are then manually rolled into a tarball and hosted at -'http://d.g.o/~titanofold/'. +These files are then manually tarballed and hosted at +http://dev.gentoo.org/~titanofold/. =20 =20 -Init Scripts -------------------------------------------------------------------------= ------- -The 'initscripts' branch contains the initscripts. These scripts have be= en -written to condense the number of files that are necessary for maintenan= ce. +Versioning +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 - -Eselect Module -------------------------------------------------------------------------= ------- -The 'eselect' branch contains the actual script for library and binary -management. +The minor version is incremented anytime a bug is fixed. The major versi= on is +incremented anytime a feature or capability is added. diff --git a/postgresql.init b/postgresql.init index ffd6c55..cda6d84 100644 --- a/postgresql.init +++ b/postgresql.init @@ -12,6 +12,7 @@ depend() { } =20 checkconfig() { + # Check that DATA_DIR has been set and exists if [ -z ${DATA_DIR} ] ; then eerror "DATA_DIR not set" eerror "HINT: Did you not update /etc/conf.d/postgresql-@SLOT@" @@ -23,6 +24,8 @@ checkconfig() { eerror " emerge --config dev-db/postgresql-server:@SLOT@" return 1 fi + + # Check for the existence of and PostgreSQL's ability to read the confi= g files. if [ ! -f ${PGDATA}/postgresql.conf -o \ ! -f ${PGDATA}/pg_hba.conf -o ! -f ${PGDATA}/pg_ident.conf ] ; then eerror "The following file(s) were not found in ${PGDATA}:" @@ -48,10 +51,17 @@ checkconfig() { eerror "HINT: Try: 'chmod 644 ${PGDATA}/*.conf'" return 1 fi - if [ -e /var/run/postgresql/.s.PGSQL.${PGPORT} ] ; then + + # Ensures @RUN@/postgresql exists for those who have it on tmpfs. + local runpath=3D"@RUN@/postgresql" + if [ ! -d ${runpath} ] ; then + mkdir -p ${runpath} + chown postgres:postgres ${runpath} + fi + if [ -e ${runpath}/.s.PGSQL.${PGPORT} ] ; then eerror "Socket conflict." eerror "A server is already listening on:" - eerror " /var/run/postgresql/.s.PGSQL.${PGPORT}" + eerror " ${runpath}/.s.PGSQL.${PGPORT}" eerror "HINT: Change PGPORT to listen on a different socket." return 1 fi