added runit scripts
This commit is contained in:
parent
2e437cd329
commit
c65de416de
81 changed files with 114 additions and 0 deletions
19
runit_scripts/postgresql/conf
Normal file
19
runit_scripts/postgresql/conf
Normal 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
|
||||
2
runit_scripts/postgresql/log/run
Executable file
2
runit_scripts/postgresql/log/run
Executable file
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
exec svlogd -tt /var/log/svlog/postgresql
|
||||
0
runit_scripts/postgresql/log/supervise/lock
Normal file
0
runit_scripts/postgresql/log/supervise/lock
Normal file
1
runit_scripts/postgresql/log/supervise/pid
Normal file
1
runit_scripts/postgresql/log/supervise/pid
Normal file
|
|
@ -0,0 +1 @@
|
|||
962
|
||||
1
runit_scripts/postgresql/log/supervise/stat
Normal file
1
runit_scripts/postgresql/log/supervise/stat
Normal file
|
|
@ -0,0 +1 @@
|
|||
run
|
||||
BIN
runit_scripts/postgresql/log/supervise/status
Normal file
BIN
runit_scripts/postgresql/log/supervise/status
Normal file
Binary file not shown.
25
runit_scripts/postgresql/run
Executable file
25
runit_scripts/postgresql/run
Executable 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
|
||||
0
runit_scripts/postgresql/supervise/lock
Normal file
0
runit_scripts/postgresql/supervise/lock
Normal file
1
runit_scripts/postgresql/supervise/pid
Normal file
1
runit_scripts/postgresql/supervise/pid
Normal file
|
|
@ -0,0 +1 @@
|
|||
963
|
||||
1
runit_scripts/postgresql/supervise/stat
Normal file
1
runit_scripts/postgresql/supervise/stat
Normal file
|
|
@ -0,0 +1 @@
|
|||
run
|
||||
BIN
runit_scripts/postgresql/supervise/status
Normal file
BIN
runit_scripts/postgresql/supervise/status
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue