diff --git a/cdist/conf/type/__systemd_unit/explorer/unit-status b/cdist/conf/type/__systemd_unit/explorer/unit-status
new file mode 100644
index 00000000..b68e5169
--- /dev/null
+++ b/cdist/conf/type/__systemd_unit/explorer/unit-status
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+# 2017 Ľubomír Kučera <lubomir.kucera.jr at gmail.com>
+#
+# This file is part of cdist.
+#
+# cdist is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# cdist is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with cdist. If not, see <http://www.gnu.org/licenses/>.
+#
+
+systemctl is-active "${__object_id}" || true
diff --git a/cdist/conf/type/__systemd_unit/gencode-remote b/cdist/conf/type/__systemd_unit/gencode-remote
index 6ea3ddaa..c608d9b3 100644
--- a/cdist/conf/type/__systemd_unit/gencode-remote
+++ b/cdist/conf/type/__systemd_unit/gencode-remote
@@ -18,14 +18,6 @@
 # along with cdist. If not, see <http://www.gnu.org/licenses/>.
 #
 
-systemctl_present=$(cat "${__object}/explorer/systemctl-present")
-
-if [ "${systemctl_present}" -ne 0 ]; then
-    echo "systemctl does not seem to be present on this system" >&2
-
-    exit 1
-fi
-
 name="${__object_id}"
 state=$(cat "${__object}/parameter/state")
 current_enablement_state=$(cat "${__object}/explorer/enablement-state")
@@ -38,6 +30,15 @@ if [ "${state}" = "absent" ]; then
     exit 0
 fi
 
+unit_status=$(cat "${__object}/explorer/unit-status")
+
+if [ -f "${__object}/parameter/restart" ]; then
+    if grep -q "^__file/etc/systemd/system/${name}" "${__messages_in}" || \
+        [ "${unit_status}" != "active" ]; then
+        echo "systemctl restart ${name} || true"
+    fi
+fi
+
 desired_enablement_state=$(cat "${__object}/parameter/enablement-state")
 
 if [ "${current_enablement_state}" = "${desired_enablement_state}" ]; then
diff --git a/cdist/conf/type/__systemd_unit/man.rst b/cdist/conf/type/__systemd_unit/man.rst
index c624e91e..88da6b30 100644
--- a/cdist/conf/type/__systemd_unit/man.rst
+++ b/cdist/conf/type/__systemd_unit/man.rst
@@ -45,7 +45,7 @@ BOOLEAN PARAMETERS
 ------------------
 
 restart
-    Restart the unit on change.
+    Restart the unit on unit file change or when the unit is inactive.
 
 MESSAGES
 --------
diff --git a/cdist/conf/type/__systemd_unit/manifest b/cdist/conf/type/__systemd_unit/manifest
index 10dc4f0c..d5f04ee6 100644
--- a/cdist/conf/type/__systemd_unit/manifest
+++ b/cdist/conf/type/__systemd_unit/manifest
@@ -18,22 +18,24 @@
 # along with cdist. If not, see <http://www.gnu.org/licenses/>.
 #
 
+systemctl_present=$(cat "${__object}/explorer/systemctl-present")
+
+if [ "${systemctl_present}" -ne 0 ]; then
+    echo "systemctl does not seem to be present on this system" >&2
+
+    exit 1
+fi
+
 name="${__object_id}"
 source=$(cat "${__object}/parameter/source")
 state=$(cat "${__object}/parameter/state")
 
-onchange() {
-    echo -n "systemctl daemon-reload"
-
-    if [ -f "${__object}/parameter/restart" ]; then
-        echo -n " && (systemctl restart ${name} || true)"
-    fi
-
-    echo
-}
+if [ -z "${source}" ] && [ "${state}" != "absent" ]; then
+    exit 0
+fi
 
 __config_file "/etc/systemd/system/${name}" \
     --mode 644 \
-    --onchange "$(onchange)" \
+    --onchange "systemctl daemon-reload" \
     --source "${source}" \
     --state "${state}"