Harmonise les bootscripts (daemon)
[hvlinux.git] / stage2 / bootscripts / klogd
diff --git a/stage2/bootscripts/klogd b/stage2/bootscripts/klogd
new file mode 100755 (executable)
index 0000000..959a90e
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# klogd
+
+# Source functions library
+source /etc/rc.d/init.d/functions
+
+log_script_name "$0 $*"
+
+DAEMON=/sbin/klogd
+DAEMON_DESC="Kernel log daemon"
+DAEMON_OPTS="-k /boot/System-$(uname -r).map"
+
+case "$1" in
+    start)
+        cmd_run_log_box_warn "${DAEMON_DESC} start" loadproc ${DAEMON} ${DAEMON_OPTS}
+       ;;
+
+    stop)
+        cmd_run_log_box_warn "${DAEMON_DESC} stop" killproc ${DAEMON}
+       ;;
+
+    restart)
+       $0 stop
+       sleep 1
+       $0 start
+       ;;
+
+    status)
+       statusproc klogd
+       ;;
+
+    *)
+       echo "Usage: $0 {start|stop|restart|status}"
+        exit ${EXIT_CODE_FAILURE}
+       ;;
+esac
+
+exit $?