Correctly handle dokku-installer init file creation on systemd instances

- Use the nginx.conf file's existence as a check for whether we should start the service or not
- Create the init files with the dokku-installer.py file. This adds actual systemd support.
- Also ensure we *always* start the service, regardless of it's status. This fixes an issue with processing systemd output
This commit is contained in:
Jose Diaz-Gonzalez
2016-01-01 21:37:42 -05:00
parent 55b2aba3a8
commit 1314b3942d
2 changed files with 7 additions and 9 deletions

10
debian/postinst vendored
View File

@@ -51,9 +51,13 @@ case "$1" in
rm -f ${DOKKU_ROOT}/VERSION
cp ${DOKKU_LIB_ROOT}/STABLE_VERSION ${DOKKU_ROOT}/VERSION
echo "starting dokku-installer if necessary"
if [ -f /etc/init/dokku-installer.conf ] && service dokku-installer status 2> /dev/null | grep waiting; then
sudo service dokku-installer start
if [[ -f /etc/nginx/conf.d/dokku-installer.conf ]]; then
echo "Setting up dokku-installer"
/usr/local/share/dokku/contrib/dokku-installer.py onboot
echo "Starting dokku-installer"
[[ -f /etc/systemd/system ]] && systemctl daemon-reload
service dokku-installer start
fi
db_get "dokku/web_config"

6
debian/preinst vendored
View File

@@ -7,14 +7,8 @@ case "$1" in
install)
db_get "dokku/web_config"
if [ "$RET" = "true" ]; then
INIT_CONF="/etc/init/dokku-installer.conf"
NGINX_CONF="/etc/nginx/conf.d/dokku-installer.conf"
rm -f $INIT_CONF
touch $INIT_CONF
echo 'start on runlevel [2345]' >> $INIT_CONF
echo 'exec /usr/local/share/dokku/contrib/dokku-installer.py selfdestruct' >> $INIT_CONF
rm -f $NGINX_CONF
touch $NGINX_CONF