From f5cee7a57d419baeb5256300e7a6133ebf0cd796 Mon Sep 17 00:00:00 2001
From: Daniel Heule <hda@sfs.biz>
Date: Tue, 7 Jan 2014 17:31:45 +0100
Subject: [PATCH] suses chkconfig has the same name, but works different

---
 cdist/conf/type/__start_on_boot/explorer/state | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/cdist/conf/type/__start_on_boot/explorer/state b/cdist/conf/type/__start_on_boot/explorer/state
index 62f86332..e9e4318e 100755
--- a/cdist/conf/type/__start_on_boot/explorer/state
+++ b/cdist/conf/type/__start_on_boot/explorer/state
@@ -39,10 +39,19 @@ case "$os" in
         [ -f "/etc/rc$runlevel.d/S"??"$name" ] || state="absent"
     ;;
 
-    amazon|centos|fedora|owl|redhat|suse)
+    amazon|centos|fedora|owl|redhat)
         state=$(chkconfig --level "$runlevel" "$name" || echo absent)
         [ "$state" ] || state="present"
     ;;
+    suse)
+        # check for target if set, usable for boot. services in runlevel B
+        if [ "$target_runlevel" != 'default' ]; then
+            runlevel="$target_runlevel"
+        fi
+        # suses chkconfig has the same name, but works different ...
+        state=$(chkconfig --check "$name" "$runlevel" || echo absent)
+        [ "$state" ] || state="present"
+    ;;
     gentoo)
         state="present"
         [ -f "/etc/runlevels/${target_runlevel}/${name}" ] || state="absent"