From 9b4be311e697776b3fb0a8053951921043ce7a5e Mon Sep 17 00:00:00 2001 From: Disassembler Date: Fri, 7 Sep 2018 18:46:30 +0200 Subject: [PATCH] ckan test --- activemq/setup.sh | 0 basic.sh | 2 +- ckan/lxc/etc/services.d/.s6-svscan/finish | 3 --- ckan/lxc/etc/services.d/ckan/run | 5 ----- ckan/lxcfile | 5 ++--- ckan/setup.sh | 10 +++++----- lxc-build | 1 + 7 files changed, 9 insertions(+), 17 deletions(-) mode change 100644 => 100755 activemq/setup.sh delete mode 100755 ckan/lxc/etc/services.d/.s6-svscan/finish delete mode 100755 ckan/lxc/etc/services.d/ckan/run diff --git a/activemq/setup.sh b/activemq/setup.sh old mode 100644 new mode 100755 diff --git a/basic.sh b/basic.sh index 0133192..5915a93 100755 --- a/basic.sh +++ b/basic.sh @@ -63,7 +63,7 @@ vmmgr create-selfsigned cp ${SOURCE_DIR}/etc/nginx/nginx.conf /etc/nginx/nginx.conf # Configure services -for SERVICE in consolefont crond iptables nginx ntpd swap vmmgr; do +for SERVICE in cgroups consolefont crond iptables nginx ntpd swap vmmgr; do rc-update add ${SERVICE} boot service ${SERVICE} start done diff --git a/ckan/lxc/etc/services.d/.s6-svscan/finish b/ckan/lxc/etc/services.d/.s6-svscan/finish deleted file mode 100755 index 78d5fdc..0000000 --- a/ckan/lxc/etc/services.d/.s6-svscan/finish +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -/bin/true diff --git a/ckan/lxc/etc/services.d/ckan/run b/ckan/lxc/etc/services.d/ckan/run deleted file mode 100755 index d37675e..0000000 --- a/ckan/lxc/etc/services.d/ckan/run +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/execlineb -P - -fdmove -c 2 1 -s6-setuidgid 8003:8003 -/usr/bin/paster serve /etc/ckan/ckan.ini diff --git a/ckan/lxcfile b/ckan/lxcfile index e53d817..ddc2578 100644 --- a/ckan/lxcfile +++ b/ckan/lxcfile @@ -47,9 +47,8 @@ SCRIPT rm -rf /root/.cache RUN -COPY lxc - MOUNT /srv/ckan/conf etc/ckan MOUNT /srv/ckan/data srv/ckan/storage -CMD /bin/s6-svscan /etc/services.d +USER 8003 8003 +CMD /usr/bin/paster serve /etc/ckan/ckan.ini diff --git a/ckan/setup.sh b/ckan/setup.sh index 9d16ee9..c82eca3 100755 --- a/ckan/setup.sh +++ b/ckan/setup.sh @@ -11,7 +11,7 @@ service solr start # Create database export CKAN_PWD=$(head -c 18 /dev/urandom | base64) export CKAN_DS_PWD=$(head -c 18 /dev/urandom | base64) -envsubst <${SOURCE_DIR}/createdb.sql | docker exec -i postgres psql +envsubst <${SOURCE_DIR}/createdb.sql | lxc-attach postgres -- /bin/s6-setuidgid 5432:5432 psql # Configure CKAN Solr core # TODO lxc-execute solr -- solr create -p 8983 -c ckan @@ -33,10 +33,10 @@ if [ ${DEBUG:-0} -eq 0 ]; then fi # Populate database -lxc-execute ckan -- paster --plugin=ckan db init -c /etc/ckan/ckan.ini -lxc-execute ckan -- paster --plugin=ckanext-spatial spatial initdb -c /etc/ckan/ckan.ini -lxc-execute ckan -- paster --plugin=ckan datastore set-permissions -c /etc/ckan/ckan.ini # TODO | lxc-attach -n postgres -- psql -chown -R 8003:8003 /srv/ckan/data +lxc-execute ckan -- /usr/bin/paster --plugin=ckan db init -c /etc/ckan/ckan.ini +lxc-execute ckan -- /usr/bin/paster --plugin=ckanext-spatial spatial initdb -c /etc/ckan/ckan.ini +lxc-execute ckan -- /usr/bin/paster --plugin=ckan datastore set-permissions -c /etc/ckan/ckan.ini | lxc-attach postgres -- /bin/s6-setuidgid 5432:5432 psql +chown -R 8003:8003 /srv/ckan/data # TODO: re)move as uid is now correct ? # Create admin account export CKAN_ADMIN_USER="admin" diff --git a/lxc-build b/lxc-build index 263ac6b..b8a100f 100755 --- a/lxc-build +++ b/lxc-build @@ -20,6 +20,7 @@ lxc.net.0.ipv4.gateway = auto lxc.rootfs.path = {rootfs} # Mounts +lxc.mount.entry = shm dev/shm tmpfs rw,nodev,noexec,nosuid,relatime,mode=1777,create=dir 0 0 lxc.mount.entry = /etc/hosts etc/hosts none bind 0 0 lxc.mount.entry = /etc/resolv.conf etc/resolv.conf none bind 0 0 {mounts}