Skip to content

Instantly share code, notes, and snippets.

@simonlynen
Forked from haad/postgresql.conf
Created January 13, 2014 20:31
Show Gist options
  • Save simonlynen/8407546 to your computer and use it in GitHub Desktop.
Save simonlynen/8407546 to your computer and use it in GitHub Desktop.
description "PostgreSQL 9.1 Server"
author "PostgreSQL"
start on runlevel [2345]
stop on runlevel [016]
expect fork
respawn
env POSTGRESQL_HOME="/var/lib/postgresql/9.1/main"
env POSTGRESQL_CONF="/etc/postgresql/9.1/main/postgresql.conf"
pre-start script
if [ -d /var/run/postgresql ]; then
chmod 2775 /var/run/postgresql
else
install -d -m 2775 -o postgres -g postgres /var/run/postgresql
fi
end script
post-start script
[ -r /usr/share/postgresql-common/init.d-functions ] || exit 0
. /usr/share/postgresql-common/init.d-functions
get_versions
for v in $versions; do
start $v
done
initctl emit inn-postgresql-start
end script
post-stop script
initctl emit inn-postgresql-stop
[ -r /usr/share/postgresql-common/init.d-functions ] || exit 0
. /usr/share/postgresql-common/init.d-functions
get_versions
for v in $versions; do
stop $v
done
end script
#exec su -c "/usr/lib/postgresql/9.1/bin/postgres -D $POSTGRESQL_HOME -c config_file=$POSTGRESQL_CONF" postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment