Skip to content

Instantly share code, notes, and snippets.

@bradleyayers
Created January 23, 2012 02:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradleyayers/1660177 to your computer and use it in GitHub Desktop.
Save bradleyayers/1660177 to your computer and use it in GitHub Desktop.
PostgreSQL 9.1 Upstart Job
description "PostgreSQL 9.1 Server"
author "PostgreSQL"
start on runlevel [2345]
stop on runlevel [016]
respawn
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
exec su -c "/usr/lib/postgresql/9.1/bin/postgres -D /var/lib/postgresql/9.1/main -c config_file=/etc/postgresql/9.1/main/postgresql.conf" postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment