diff --git a/meta-phosphor/classes/obmc-phosphor-systemd.bbclass b/meta-phosphor/classes/obmc-phosphor-systemd.bbclass
index 3df5ee4..dba39d3 100644
--- a/meta-phosphor/classes/obmc-phosphor-systemd.bbclass
+++ b/meta-phosphor/classes/obmc-phosphor-systemd.bbclass
@@ -8,6 +8,11 @@
 #
 # Alternatively this class can just be inherited and
 # ${PN}.service will be added to the main package.
+#
+# Other variables:
+# INHIBIT_SYSTEMD_RESTART_POLICY_${unit}
+#    Inhibit the warning that is displayed if a service unit without a
+#    restart policy is detected.
 
 inherit obmc-phosphor-utils
 inherit systemd
@@ -15,16 +20,45 @@
 _INSTALL_SD_UNITS=""
 
 
+def systemd_is_service(unit):
+    return unit.endswith('.service')
+
+
+def systemd_is_template(unit):
+    return '@.' in unit
+
+
+def systemd_parse_unit(d, path):
+    import ConfigParser
+    parser = ConfigParser.SafeConfigParser()
+    parser.optionxform = str
+    parser.read('%s' % path)
+    return parser
+
+
 python() {
-    def add_sd_unit(d, unit, pkg):
+    def check_sd_unit(d, unit):
         searchpaths = d.getVar('FILESPATH', True)
         path = bb.utils.which(searchpaths, '%s' % unit)
         if not os.path.isfile(path):
             bb.fatal('Did not find unit file "%s"' % unit)
+
+        parser = systemd_parse_unit(d, path)
+        inhibit = listvar_to_list(d, 'INHIBIT_SYSTEMD_RESTART_POLICY_WARNING')
+        if systemd_is_service(unit) and \
+                not systemd_is_template(unit) and \
+                unit not in inhibit and \
+                not parser.has_option('Service', 'Restart'):
+            bb.warn('Systemd unit \'%s\' does not '
+                'have a restart policy defined.' % unit)
+
+
+    def add_sd_unit(d, unit, pkg):
         set_append(d, 'SRC_URI', 'file://%s' % unit)
         set_append(d, 'FILES_%s' % pkg, '%s/%s' \
             % (d.getVar('systemd_system_unitdir', True), unit))
-        set_append(d, '_INSTALL_SD_UNITS', '%s' % unit)
+        set_append(d, '_INSTALL_SD_UNITS', unit)
+
 
     pn = d.getVar('PN', True)
     if d.getVar('SYSTEMD_SERVICE_%s' % pn, True) is None:
@@ -32,6 +66,7 @@
 
     for pkg in listvar_to_list(d, 'SYSTEMD_PACKAGES'):
         for unit in listvar_to_list(d, 'SYSTEMD_SERVICE_%s' % pkg):
+            check_sd_unit(d, unit)
             add_sd_unit(d, unit, pkg)
 }
 
