postgres uid tryfix
This commit is contained in:
parent
9a8c2103d4
commit
5db1ed2baf
@ -84,7 +84,7 @@ class LXCImage:
|
|||||||
uidgid = line.split()
|
uidgid = line.split()
|
||||||
self.set_user(uidgid[1], uidgid[2])
|
self.set_user(uidgid[1], uidgid[2])
|
||||||
elif line.startswith('CMD'):
|
elif line.startswith('CMD'):
|
||||||
self.set_cmd(line.split()[1])
|
self.set_cmd(' '.join(line.split()[1:]))
|
||||||
# Add the final layer which can be treated as nonpersistent
|
# Add the final layer which can be treated as nonpersistent
|
||||||
self.add_layer('{}/delta0'.format(self.name))
|
self.add_layer('{}/delta0'.format(self.name))
|
||||||
|
|
||||||
|
3
postgres/lxc/etc/services.d/.s6-svscan/finish
Executable file
3
postgres/lxc/etc/services.d/.s6-svscan/finish
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
/bin/true
|
5
postgres/lxc/etc/services.d/postgres/run
Executable file
5
postgres/lxc/etc/services.d/postgres/run
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
|
||||||
|
fdmove -c 2 1
|
||||||
|
s6-setuidgid 5432:5432
|
||||||
|
/usr/bin/postgres -D /var/lib/postgresql
|
@ -20,5 +20,4 @@ RUN
|
|||||||
|
|
||||||
MOUNT /srv/postgres/data var/lib/postgresql
|
MOUNT /srv/postgres/data var/lib/postgresql
|
||||||
|
|
||||||
USER 5432 5432
|
CMD s6-svscan /etc/services.d
|
||||||
CMD postgres -D /var/lib/postgresql
|
|
||||||
|
@ -7,7 +7,7 @@ SOURCE_DIR=$(realpath $(dirname "${0}"))/setup
|
|||||||
mkdir -p /srv/postgres/data
|
mkdir -p /srv/postgres/data
|
||||||
chown -R 5432:5432 /srv/postgres/data
|
chown -R 5432:5432 /srv/postgres/data
|
||||||
chmod 700 /srv/postgres/data
|
chmod 700 /srv/postgres/data
|
||||||
lxc-execute -n postgres -- sh -lc 'initdb -D /var/lib/postgresql'
|
lxc-execute -n postgres -- /usr/bin/initdb -D /var/lib/postgresql
|
||||||
|
|
||||||
# Configure Postgres
|
# Configure Postgres
|
||||||
cp ${SOURCE_DIR}/srv/postgres/data/postgresql.conf /srv/postgres/data/postgresql.conf
|
cp ${SOURCE_DIR}/srv/postgres/data/postgresql.conf /srv/postgres/data/postgresql.conf
|
||||||
|
@ -11,7 +11,7 @@ start() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
start_post() {
|
start_post() {
|
||||||
ewaitfile 60 /var/lib/lxc/postgres/delta0/var/run/postgresql/.s.PGSQL.5432
|
ewaitfile 60 /var/lib/lxc/postgres/delta0/run/postgresql/.s.PGSQL.5432
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
|
@ -63,7 +63,7 @@ listen_addresses = '*' # what IP address(es) to listen on;
|
|||||||
#port = 5432 # (change requires restart)
|
#port = 5432 # (change requires restart)
|
||||||
max_connections = 100 # (change requires restart)
|
max_connections = 100 # (change requires restart)
|
||||||
#superuser_reserved_connections = 3 # (change requires restart)
|
#superuser_reserved_connections = 3 # (change requires restart)
|
||||||
unix_socket_directories = '/run/postgresql,/tmp' # comma-separated list of directories
|
unix_socket_directories = '/run/postgresql' # comma-separated list of directories
|
||||||
# (change requires restart)
|
# (change requires restart)
|
||||||
#unix_socket_group = '' # (change requires restart)
|
#unix_socket_group = '' # (change requires restart)
|
||||||
#unix_socket_permissions = 0777 # begin with 0 to use octal notation
|
#unix_socket_permissions = 0777 # begin with 0 to use octal notation
|
||||||
|
Loading…
Reference in New Issue
Block a user