Add postgresql

This commit is contained in:
Eugen Wissner 2025-05-26 21:17:15 +02:00
parent 1e8f8cd3dd
commit 22994bb869
Signed by: belka
GPG Key ID: A27FDC1E8EE902C0
25 changed files with 89 additions and 0 deletions

View File

@ -0,0 +1 @@
postgresql-srv

View File

@ -0,0 +1,4 @@
# Comment out "remount-root" and uncomment "local-fs"
# if you use separate partition for /var/log
remount-root
#local-fs

1
rc.postgresql/postgresql-log/env/CMD vendored Normal file
View File

@ -0,0 +1 @@
s6-log

View File

@ -0,0 +1 @@
-d3

View File

@ -0,0 +1,2 @@
root
# Logging directory group ownership

View File

@ -0,0 +1,2 @@
root
# Logging directory owner

View File

@ -0,0 +1,2 @@
/var/log/postgresql
# Logging directory path

View File

@ -0,0 +1,2 @@
750
# Logging directory access rights in octal

View File

@ -0,0 +1,2 @@
n4 s500000 $LOGDIR_PATH
# Logging script used by s6-log

View File

@ -0,0 +1 @@
3

View File

@ -0,0 +1 @@
postgresql

View File

@ -0,0 +1,24 @@
#!/bin/execlineb -P
####################################################
# Start a logging daemon for the postgresql daemon #
####################################################
s6-envdir env
multisubstitute {
importas -u LOGDIR_OWNER LOGDIR_OWNER
importas -u LOGDIR_GROUP LOGDIR_GROUP
importas -u LOGDIR_PERMS LOGDIR_PERMS
importas -u CMD CMD
importas -usCd" " CMD_OPTS CMD_OPTS
importas -usCd" " LOG_SCRIPT LOG_SCRIPT
}
s6-envuidgid -B ${LOGDIR_OWNER}:${LOGDIR_GROUP}
multisubstitute {
importas -u LOGDIR_PATH LOGDIR_PATH
importas -u UID UID
importas -u GID GID
}
if { install -dm $LOGDIR_PERMS -o $UID -g $GID $LOGDIR_PATH }
s6-setuidgid ${UID}:${GID}
exec -c $CMD $CMD_OPTS -- $LOG_SCRIPT

View File

@ -0,0 +1 @@
longrun

View File

@ -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 =

View File

@ -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

View File

@ -0,0 +1 @@
SIGINT

1
rc.postgresql/postgresql-srv/env/CMD vendored Normal file
View File

@ -0,0 +1 @@
/usr/lib64/postgresql/${PG_VERSION}/bin/postgres

View File

@ -0,0 +1 @@
-D /var/lib/pgsql/${PG_VERSION}/data

View File

@ -0,0 +1 @@
/proc/self/oom_score_adj

View File

@ -0,0 +1 @@
0

View File

@ -0,0 +1 @@
14

View File

@ -0,0 +1 @@
3

View File

@ -0,0 +1 @@
postgresql-log

View File

@ -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

View File

@ -0,0 +1 @@
longrun