]> git.pld-linux.org Git - packages/postgresql.git/commitdiff
- proof of concept native upstart job implementation: postgresql as an example
authorJacek Konieczny <jajcus@pld-linux.org>
Fri, 7 May 2010 13:02:42 +0000 (13:02 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
  of multi-instace service.

Changed files:
    postgresql-instance.upstart -> 1.1
    postgresql.upstart -> 1.1

postgresql-instance.upstart [new file with mode: 0644]
postgresql.upstart [new file with mode: 0644]

diff --git a/postgresql-instance.upstart b/postgresql-instance.upstart
new file mode 100644 (file)
index 0000000..e0274e0
--- /dev/null
@@ -0,0 +1,18 @@
+
+stop on pld.shutdown-started
+stop on stopping postgresql
+
+instance $DATADIR
+
+env DATADIR=/var/lib/pgsql
+
+script
+       exec >>/var/log/pgsql 2>&1
+       exec /sbin/setuidgid -s postgres \
+               /usr/bin/postgres -D $DATADIR
+end script
+
+
+
+
+
diff --git a/postgresql.upstart b/postgresql.upstart
new file mode 100644 (file)
index 0000000..bfc83a0
--- /dev/null
@@ -0,0 +1,18 @@
+description "Starts PostgreSQL instances for all configured clusters"
+
+start on started SERVICE=syslog
+
+env PG_DB_CLUSTERS=
+
+pre-start script
+       exec >/tmp/pre-start 2>&1
+       set -x
+       if [ -z "$PG_DB_CLUSTERS" ] ; then
+               # read PG_DB_CLUSTERS from /etc/sysconfig/postgresql
+               # for init script compatibility
+               . /etc/sysconfig/postgresql
+       fi
+       for DATADIR in $PG_DB_CLUSTERS ; do
+               start postgresql/instance DATADIR=$DATADIR
+       done
+end script
This page took 0.086428 seconds and 4 git commands to generate.