added runit scripts

This commit is contained in:
tomit4 2022-02-23 12:16:48 -08:00
parent 2e437cd329
commit c65de416de
81 changed files with 114 additions and 0 deletions

View file

@ -0,0 +1,19 @@
# Configuration file for the PostgreSQL server.
# PostgreSQL's database directory
PGROOT="/var/lib/postgres"
# PostgreSQL's log file.
PGLOG="/var/log/postgresql.log"
# Passed to initdb if necessary
INITOPTS="-A peer --auth-host=md5 --auth-local=peer --locale en_US.UTF-8"
# Extra options to run postmaster with, e.g.:
# -N is the maximal number of client connections
# -B is the number of shared buffers and has to be at least 2x the value for -N
# Please read the man-page to postmaster for more options. Many of these options
# can be set directly in the configuration-file.
#PGOPTS="-N 512 -B 1024"
#
mkdir -p /run/postgresql/ && chown postgres:postgres /run/postgresql

View file

@ -0,0 +1,2 @@
#!/bin/sh
exec svlogd -tt /var/log/svlog/postgresql

View file

@ -0,0 +1 @@
962

View file

@ -0,0 +1 @@
run

Binary file not shown.

25
runit_scripts/postgresql/run Executable file
View file

@ -0,0 +1,25 @@
#!/bin/sh
[ -r conf ] && . ./conf
: ${PGDATA:="$PGROOT/data"}
if [ "$PGROOT" != "/var/lib/postgres" ]; then
echo "Creating symlink /var/lib/postgres -> $PGROOT"
ln -sf "$PGROOT" /var/lib/postgres
fi
if [ ! -d "$PGDATA" ]; then
echo "Initializing database in $PGDATA"
mkdir -p "$PGDATA"
chown -R postgres:postgres "$PGDATA"
chmod 777 "$PGDATA"
su - postgres -m -c "/usr/bin/initdb $INITOPTS -D '$PGDATA'" >/dev/null
if [ -f /etc/postgresql/postgresql.conf ]; then
ln -sf /etc/postgresql/postgresql.conf "$PGDATA/postgresql.conf"
fi
fi
exec chpst -u postgres:postgres postgres -D "$PGDATA" $PGOPTS 2>&1

View file

View file

@ -0,0 +1 @@
963

View file

@ -0,0 +1 @@
run

Binary file not shown.