diff --git a/salt/modules/systemd.py b/salt/modules/systemd.py index b8c7b77216..76c9cda009 100644 --- a/salt/modules/systemd.py +++ b/salt/modules/systemd.py @@ -31,15 +31,10 @@ def _sd_booted(): try: # This check does the same as sd_booted() from libsystemd-daemon: # http://www.freedesktop.org/software/systemd/man/sd_booted.html - cgroup_fs = os.stat('/sys/fs/cgroup') - cgroup_systemd = os.stat('/sys/fs/cgroup/systemd') + if os.stat('/run/systemd/system'): + __context__['systemd.sd_booted'] = True except OSError: __context__['systemd.sd_booted'] = False - else: - if cgroup_fs.st_dev != cgroup_systemd.st_dev: - __context__['systemd.sd_booted'] = True - else: - __context__['systemd.sd_booted'] = False return __context__['systemd.sd_booted']