summaryrefslogtreecommitdiffstats
path: root/import-layers/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql.init
diff options
context:
space:
mode:
authorDave Cobbley <david.j.cobbley@linux.intel.com>2018-08-14 10:05:37 -0700
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-08-22 21:26:31 -0400
commiteb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch)
treede291a73dc37168da6370e2cf16c347d1eba9df8 /import-layers/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql.init
parent9c3cf826d853102535ead04cebc2d6023eff3032 (diff)
downloadblackbird-openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.gz
blackbird-openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.zip
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers content to the top level. Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com> Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'import-layers/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql.init')
-rw-r--r--import-layers/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql.init193
1 files changed, 0 insertions, 193 deletions
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql.init b/import-layers/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql.init
deleted file mode 100644
index 4a4f0cd16..000000000
--- a/import-layers/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql.init
+++ /dev/null
@@ -1,193 +0,0 @@
-#!/bin/sh
-#
-# postgresql This is the init script for starting up the PostgreSQL
-# server.
-#
-# chkconfig: - 64 36
-# description: PostgreSQL database server.
-# processname: postmaster
-# pidfile: /var/run/postmaster.PORT.pid
-
-# This script is slightly unusual in that the name of the daemon (postmaster)
-# is not the same as the name of the subsystem (postgresql)
-
-# PGVERSION is the full package version, e.g., 8.4.0
-# Note: the specfile inserts the correct value during package build
-PGVERSION=9.2.4
-# PGMAJORVERSION is major version, e.g., 8.4 (this should match PG_VERSION)
-PGMAJORVERSION=`echo "$PGVERSION" | sed 's/^\([0-9]*\.[0-9]*\).*$/\1/'`
-
-# Source function library.
-. /etc/init.d/functions
-
-# Find the name of the script
-NAME=`basename $0`
-if [ ${NAME:0:1} = "S" -o ${NAME:0:1} = "K" ]
-then
- NAME=${NAME:3}
-fi
-
-# For SELinux we need to use 'runuser' not 'su'
-if [ -x /sbin/runuser ]
-then
- SU=runuser
-else
- SU=su
-fi
-
-
-# Set defaults for configuration variables
-PGENGINE=/usr/bin
-PGPORT=5432
-PGDATA=/var/lib/postgresql/data
-PGLOG=/var/lib/postgresql/pgstartup.log
-# Value to set as postmaster process's oom_adj
-PG_OOM_ADJ=-17
-
-# Override defaults from /etc/sysconfig/postgresql if file is present
-[ -f /etc/default/postgresql/${NAME} ] && . /etc/default/postgresql/${NAME}
-
-export PGDATA
-export PGPORT
-
-lockfile="/var/lock/subsys/${NAME}"
-pidfile="/var/run/postmaster.${PGPORT}.pid"
-
-script_result=0
-
-start(){
- [ -x "$PGENGINE/postmaster" ] || exit 5
-
- PSQL_START=$"Starting ${NAME} service: "
-
- # Make sure startup-time log file is valid
- if [ ! -e "$PGLOG" -a ! -h "$PGLOG" ]
- then
- touch "$PGLOG" || exit 4
- chown postgres:postgres "$PGLOG"
- chmod go-rwx "$PGLOG"
- [ -x /sbin/restorecon ] && /sbin/restorecon "$PGLOG"
- fi
-
- # Check for the PGDATA structure
- if [ -f "$PGDATA/PG_VERSION" ] && [ -d "$PGDATA/base" ]
- then
- # Check version of existing PGDATA
- if [ x`cat "$PGDATA/PG_VERSION"` != x"$PGMAJORVERSION" ]
- then
- SYSDOCDIR="(Your System's documentation directory)"
- if [ -d "/usr/doc/postgresql-$PGVERSION" ]
- then
- SYSDOCDIR=/usr/doc
- fi
- if [ -d "/usr/share/doc/postgresql-$PGVERSION" ]
- then
- SYSDOCDIR=/usr/share/doc
- fi
- if [ -d "/usr/doc/packages/postgresql-$PGVERSION" ]
- then
- SYSDOCDIR=/usr/doc/packages
- fi
- if [ -d "/usr/share/doc/packages/postgresql-$PGVERSION" ]
- then
- SYSDOCDIR=/usr/share/doc/packages
- fi
- echo
- echo $"An old version of the database format was found."
- echo $"You need to upgrade the data format before using PostgreSQL."
- echo $"See $SYSDOCDIR/postgresql-$PGVERSION/README.rpm-dist for more information."
- exit 1
- fi
- else
- # No existing PGDATA! Warn the user to initdb it.
- echo
- echo "$PGDATA is missing. Use \"postgresql-setup initdb\" to initialize the cluster first."
- echo -n " [FAILED] "
- echo
- exit 1
- fi
-
- echo -n "$PSQL_START"
- test x"$PG_OOM_ADJ" != x && echo "$PG_OOM_ADJ" > /proc/self/oom_score_adj
- $SU -l postgres -c "$PGENGINE/postmaster -p '$PGPORT' -D '$PGDATA' ${PGOPTS} &" >> "$PGLOG" 2>&1 < /dev/null
- sleep 2
- pid=`head -n 1 "$PGDATA/postmaster.pid" 2>/dev/null`
- if [ "x$pid" != x ]
- then
- echo -n " [ OK ]"
- touch "$lockfile"
- echo $pid > "$pidfile"
- echo
- else
- echo -n " [FAILED]"
- echo
- script_result=1
- fi
-}
-
-stop(){
- echo -n $"Stopping ${NAME} service: "
- if [ -e "$lockfile" ]
- then
- $SU -l postgres -c "$PGENGINE/pg_ctl stop -D '$PGDATA' -s -m fast" > /dev/null 2>&1 < /dev/null
- ret=$?
- if [ $ret -eq 0 ]
- then
- echo -n " [ OK ] "
- rm -f "$pidfile"
- rm -f "$lockfile"
- else
- echo -n " [FAILED] "
- script_result=1
- fi
- else
- # not running; per LSB standards this is "ok"
- echo -n " [ OK ] "
- fi
- echo
-}
-
-restart(){
- stop
- start
-}
-
-condrestart(){
- [ -e "$lockfile" ] && restart || :
-}
-
-reload(){
- $SU -l postgres -c "$PGENGINE/pg_ctl reload -D '$PGDATA' -s" > /dev/null 2>&1 < /dev/null
-}
-
-
-# See how we were called.
-case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- status)
- status postmaster
- script_result=$?
- ;;
- restart)
- restart
- ;;
- condrestart|try-restart)
- condrestart
- ;;
- reload)
- reload
- ;;
- force-reload)
- restart
- ;;
- *)
- echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
- exit 2
-esac
-
-exit $script_result
OpenPOWER on IntegriCloud