From 1581884c6d6134f00c7d2671d40deff06b4822a8 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 1 Jan 2016 21:34:09 -0500 Subject: [PATCH] Fix issue where installer created dokku-installer for both upstart and systemd We should only create the upstart version if the OS does not use systemd. --- contrib/dokku-installer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/dokku-installer.py b/contrib/dokku-installer.py index 8d824f12b..bf11abaee 100755 --- a/contrib/dokku-installer.py +++ b/contrib/dokku-installer.py @@ -38,10 +38,6 @@ def check_boot(): systemd_dir = os.getenv('SYSTEMD_DIR', '/etc/systemd/system') nginx_dir = os.getenv('NGINX_DIR', '/etc/nginx/conf.d') - if os.path.exists(init_dir): - with open('{0}/dokku-installer.conf'.format(init_dir), 'w') as f: - f.write("start on runlevel [2345]\n") - f.write("exec {0} selfdestruct\n".format(os.path.abspath(__file__))) if os.path.exists(systemd_dir): with open('{0}/dokku-installer.service'.format(systemd_dir), 'w') as f: f.write("[Unit]\n") @@ -53,6 +49,10 @@ def check_boot(): f.write("[Install]\n") f.write("WantedBy=multi-user.target\n") f.write("WantedBy=graphical.target\n") + elif os.path.exists(init_dir): + with open('{0}/dokku-installer.conf'.format(init_dir), 'w') as f: + f.write("start on runlevel [2345]\n") + f.write("exec {0} selfdestruct\n".format(os.path.abspath(__file__))) if os.path.exists(nginx_dir): with open('{0}/dokku-installer.conf'.format(nginx_dir), 'w') as f: f.write("upstream dokku-installer { server 127.0.0.1:2000; }\n")