diff options
author | Aaron W. Swenson <titanofold@gentoo.org> | 2011-09-18 15:25:41 -0400 |
---|---|---|
committer | Aaron W. Swenson <titanofold@gentoo.org> | 2011-09-18 15:25:41 -0400 |
commit | d522eeff49e2c428b9873e640e3a779a5bbf7731 (patch) | |
tree | 3834abebaca69707e58ffd92f1755c6c225345e9 | |
parent | Beautified output a bit. (diff) | |
download | patches-d522eeff49e2c428b9873e640e3a779a5bbf7731.tar.gz patches-d522eeff49e2c428b9873e640e3a779a5bbf7731.tar.bz2 patches-d522eeff49e2c428b9873e640e3a779a5bbf7731.zip |
Added {,/var}/run creation and updated README to match up with these files.
-rw-r--r-- | README | 30 | ||||
-rw-r--r-- | postgresql.init | 14 |
2 files changed, 25 insertions, 19 deletions
@@ -1,22 +1,18 @@ -This repository is split into three primary branches. +=========== +Initscripts +=========== -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 highest -version they work with. +postgresql.confd and postgresql.init have been written to condense the number of +files that are necessary for maintenance. The dev-db/postgresql-server ebuilds +sed the files replacing @SLOT@ with the proper slot number and @RUN@ with either +/run or /var/run, depending on if /run exists. -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/. -Init Scripts -------------------------------------------------------------------------------- -The 'initscripts' branch contains the initscripts. These scripts have been -written to condense the number of files that are necessary for maintenance. +Versioning +========== - -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 version 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() { } 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 config 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="@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 |