summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2014-07-24 08:28:25 -0400
committerScott Moser <smoser@ubuntu.com>2014-07-24 08:28:25 -0400
commitd85a03dde58fe4408183b170cf2a8279ad3b96f2 (patch)
tree39d2ba4a5fc9201e0bce4ce91ded4caeb844de93
parente921336a402423a702c74b757551bee10f3d771d (diff)
parentc0a423ea72b4e9c8e21c07c5ca27dee54133fc19 (diff)
downloadvyos-cloud-init-d85a03dde58fe4408183b170cf2a8279ad3b96f2.tar.gz
vyos-cloud-init-d85a03dde58fe4408183b170cf2a8279ad3b96f2.zip
change default path of systemd files to /lib/sysemd/system.
-rw-r--r--ChangeLog2
-rwxr-xr-xsetup.py38
2 files changed, 24 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index f11f2c73..ae7957b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,8 @@
- fix 'make test' in python 2.6
- support jinja2 as a templating engine. Drop the hard requirement on
cheetah. This helps in python3 effort. (LP: #1219223)
+ - change install path for systemd files to /lib/systemd/system
+ [Dimitri John Ledkov]
0.7.5:
- open 0.7.5
- Add a debug log message around import failures
diff --git a/setup.py b/setup.py
index 9118e5f6..9ec038fd 100755
--- a/setup.py
+++ b/setup.py
@@ -35,22 +35,6 @@ import subprocess
def is_f(p):
return os.path.isfile(p)
-
-INITSYS_FILES = {
- 'sysvinit': [f for f in glob('sysvinit/redhat/*') if is_f(f)],
- 'sysvinit_deb': [f for f in glob('sysvinit/debian/*') if is_f(f)],
- 'systemd': [f for f in glob('systemd/*') if is_f(f)],
- 'upstart': [f for f in glob('upstart/*') if is_f(f)],
-}
-INITSYS_ROOTS = {
- 'sysvinit': '/etc/rc.d/init.d',
- 'sysvinit_deb': '/etc/init.d',
- 'systemd': '/etc/systemd/system/',
- 'upstart': '/etc/init/',
-}
-INITSYS_TYPES = sorted(list(INITSYS_ROOTS.keys()))
-
-
def tiny_p(cmd, capture=True):
# Darn python 2.6 doesn't have check_output (argggg)
stdout = subprocess.PIPE
@@ -67,6 +51,28 @@ def tiny_p(cmd, capture=True):
% (cmd, ret, out, err))
return (out, err)
+def systemd_unitdir():
+ cmd = ['pkg-config', '--variable=systemdsystemunitdir', 'systemd']
+ try:
+ (path, err) = tiny_p(cmd)
+ except:
+ return '/lib/systemd/system'
+ return str(path).strip()
+
+INITSYS_FILES = {
+ 'sysvinit': [f for f in glob('sysvinit/redhat/*') if is_f(f)],
+ 'sysvinit_deb': [f for f in glob('sysvinit/debian/*') if is_f(f)],
+ 'systemd': [f for f in glob('systemd/*') if is_f(f)],
+ 'upstart': [f for f in glob('upstart/*') if is_f(f)],
+}
+INITSYS_ROOTS = {
+ 'sysvinit': '/etc/rc.d/init.d',
+ 'sysvinit_deb': '/etc/init.d',
+ 'systemd': systemd_unitdir(),
+ 'upstart': '/etc/init/',
+}
+INITSYS_TYPES = sorted(list(INITSYS_ROOTS.keys()))
+
def get_version():
cmd = ['tools/read-version']