summaryrefslogtreecommitdiff
path: root/rc.postgresql/postgresql-srv
diff options
context:
space:
mode:
Diffstat (limited to 'rc.postgresql/postgresql-srv')
-rwxr-xr-xrc.postgresql/postgresql-srv/data/check7
-rw-r--r--rc.postgresql/postgresql-srv/dependencies6
-rw-r--r--rc.postgresql/postgresql-srv/down-signal1
-rw-r--r--rc.postgresql/postgresql-srv/env/CMD1
-rw-r--r--rc.postgresql/postgresql-srv/env/CMD_OPTS1
-rw-r--r--rc.postgresql/postgresql-srv/env/PG_OOM_ADJUST_FILE1
-rw-r--r--rc.postgresql/postgresql-srv/env/PG_OOM_ADJUST_VALUE1
-rw-r--r--rc.postgresql/postgresql-srv/env/PG_VERSION1
-rw-r--r--rc.postgresql/postgresql-srv/notification-fd1
-rw-r--r--rc.postgresql/postgresql-srv/producer-for1
-rw-r--r--rc.postgresql/postgresql-srv/run23
-rw-r--r--rc.postgresql/postgresql-srv/type1
12 files changed, 45 insertions, 0 deletions
diff --git a/rc.postgresql/postgresql-srv/data/check b/rc.postgresql/postgresql-srv/data/check
new file mode 100755
index 0000000..bc8bb10
--- /dev/null
+++ b/rc.postgresql/postgresql-srv/data/check
@@ -0,0 +1,7 @@
+#!/bin/execlineb -P
+
+s6-envdir env
+importas -u PG_VERSION PG_VERSION
+pipeline { tail -n1 /var/lib/pgsql/${PG_VERSION}/data/postmaster.pid }
+pipeline { tr -d " \n" }
+xargs test ready =
diff --git a/rc.postgresql/postgresql-srv/dependencies b/rc.postgresql/postgresql-srv/dependencies
new file mode 100644
index 0000000..bf84970
--- /dev/null
+++ b/rc.postgresql/postgresql-srv/dependencies
@@ -0,0 +1,6 @@
+procfs
+network
+# Comment out "remount-root" and uncomment "local-fs"
+# if you use separate partition for /var
+#remount-root
+local-fs
diff --git a/rc.postgresql/postgresql-srv/down-signal b/rc.postgresql/postgresql-srv/down-signal
new file mode 100644
index 0000000..d751378
--- /dev/null
+++ b/rc.postgresql/postgresql-srv/down-signal
@@ -0,0 +1 @@
+SIGINT
diff --git a/rc.postgresql/postgresql-srv/env/CMD b/rc.postgresql/postgresql-srv/env/CMD
new file mode 100644
index 0000000..ebd1610
--- /dev/null
+++ b/rc.postgresql/postgresql-srv/env/CMD
@@ -0,0 +1 @@
+/usr/lib64/postgresql/${PG_VERSION}/bin/postgres
diff --git a/rc.postgresql/postgresql-srv/env/CMD_OPTS b/rc.postgresql/postgresql-srv/env/CMD_OPTS
new file mode 100644
index 0000000..ebe0e69
--- /dev/null
+++ b/rc.postgresql/postgresql-srv/env/CMD_OPTS
@@ -0,0 +1 @@
+-D /var/lib/pgsql/${PG_VERSION}/data
diff --git a/rc.postgresql/postgresql-srv/env/PG_OOM_ADJUST_FILE b/rc.postgresql/postgresql-srv/env/PG_OOM_ADJUST_FILE
new file mode 100644
index 0000000..ab41318
--- /dev/null
+++ b/rc.postgresql/postgresql-srv/env/PG_OOM_ADJUST_FILE
@@ -0,0 +1 @@
+/proc/self/oom_score_adj
diff --git a/rc.postgresql/postgresql-srv/env/PG_OOM_ADJUST_VALUE b/rc.postgresql/postgresql-srv/env/PG_OOM_ADJUST_VALUE
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/rc.postgresql/postgresql-srv/env/PG_OOM_ADJUST_VALUE
@@ -0,0 +1 @@
+0
diff --git a/rc.postgresql/postgresql-srv/env/PG_VERSION b/rc.postgresql/postgresql-srv/env/PG_VERSION
new file mode 100644
index 0000000..8351c19
--- /dev/null
+++ b/rc.postgresql/postgresql-srv/env/PG_VERSION
@@ -0,0 +1 @@
+14
diff --git a/rc.postgresql/postgresql-srv/notification-fd b/rc.postgresql/postgresql-srv/notification-fd
new file mode 100644
index 0000000..00750ed
--- /dev/null
+++ b/rc.postgresql/postgresql-srv/notification-fd
@@ -0,0 +1 @@
+3
diff --git a/rc.postgresql/postgresql-srv/producer-for b/rc.postgresql/postgresql-srv/producer-for
new file mode 100644
index 0000000..ffe5b68
--- /dev/null
+++ b/rc.postgresql/postgresql-srv/producer-for
@@ -0,0 +1 @@
+postgresql-log
diff --git a/rc.postgresql/postgresql-srv/run b/rc.postgresql/postgresql-srv/run
new file mode 100644
index 0000000..2aa341d
--- /dev/null
+++ b/rc.postgresql/postgresql-srv/run
@@ -0,0 +1,23 @@
+#!/bin/execlineb -P
+
+###################################################################
+# Start PostgreSQL (object-relational database management system) #
+###################################################################
+
+fdmove -c 2 1
+getpid PID
+s6-envdir env
+multisubstitute {
+ importas -u PID PID
+ importas -u CMD CMD
+ importas -usCd" " CMD_OPTS CMD_OPTS
+}
+importas -u PG_VERSION PG_VERSION
+foreground {
+ if { test -e /proc/${PID}/oom_score_adj }
+ redirfd -w 1 /proc/${PID}/oom_score_adj
+ echo -1000
+}
+s6-notifyoncheck
+s6-setuidgid postgres
+exec -c $CMD $CMD_OPTS
diff --git a/rc.postgresql/postgresql-srv/type b/rc.postgresql/postgresql-srv/type
new file mode 100644
index 0000000..5883cff
--- /dev/null
+++ b/rc.postgresql/postgresql-srv/type
@@ -0,0 +1 @@
+longrun