summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorDimitri John Ledkov <dimitri.ledkov@canonical.com>2014-07-23 14:54:14 +0100
committerDimitri John Ledkov <dimitri.ledkov@canonical.com>2014-07-23 14:54:14 +0100
commita11e3764f1fdd8bf6f192dba2c1bcc7fbb803a01 (patch)
treebb708548766404623d087b42eac4c9ec68002a48 /setup.py
parente9f9c1e1cd47786b93491fd0f73467674c88828e (diff)
downloadvyos-cloud-init-a11e3764f1fdd8bf6f192dba2c1bcc7fbb803a01.tar.gz
vyos-cloud-init-a11e3764f1fdd8bf6f192dba2c1bcc7fbb803a01.zip
Make systemd root installation dir appropriate for debian-like systems, else fallback to universally acceptable one.
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index 9118e5f6..f8566e34 100755
--- a/setup.py
+++ b/setup.py
@@ -35,6 +35,10 @@ import subprocess
def is_f(p):
return os.path.isfile(p)
+if is_f('/etc/debian_version'):
+ systemd_root = '/lib/systemd/system/'
+else:
+ systemd_root = '/etc/systemd/system/'
INITSYS_FILES = {
'sysvinit': [f for f in glob('sysvinit/redhat/*') if is_f(f)],
@@ -45,7 +49,7 @@ INITSYS_FILES = {
INITSYS_ROOTS = {
'sysvinit': '/etc/rc.d/init.d',
'sysvinit_deb': '/etc/init.d',
- 'systemd': '/etc/systemd/system/',
+ 'systemd': systemd_root,
'upstart': '/etc/init/',
}
INITSYS_TYPES = sorted(list(INITSYS_ROOTS.keys()))