Date: Wed, 29 Apr 2015 09:59:17 GMT From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r284784 - soc2013/def/crashdump-head/etc/rc.d Message-ID: <201504290959.t3T9xHZI035637@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: def Date: Wed Apr 29 09:59:17 2015 New Revision: 284784 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=284784 Log: Add cryptcore rc.d script. Added: soc2013/def/crashdump-head/etc/rc.d/cryptcore Added: soc2013/def/crashdump-head/etc/rc.d/cryptcore ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2013/def/crashdump-head/etc/rc.d/cryptcore Wed Apr 29 09:59:17 2015 (r284784) @@ -0,0 +1,35 @@ +#!/bin/sh + +# PROVIDE: cryptcore +# REQUIRE: savecore syslogd +# KEYWORD: nojail + +. /etc/rc.subr + +name="cryptcore" +rcvar="cryptcore_enable" +start_cmd="${name}_start" +stop_cmd=":" + +cryptcore_start() +{ + + sysctl -Nq kern.ekcd.enable >/dev/null + if [ $? -ne 0 ]; then + err 1 "Kernel is missing encrypted kernel crash dumps." + fi + + if [ ! -f "${cryptcore_pubkey}" ]; then + err 1 "Invalid path to a public key." + fi + + cryptcore genkey -p ${cryptcore_pubkey} + if [ $? -ne 0 ]; then + err 1 "Unable to generate an one-time key." + fi + + sysctl kern.ekcd.enable=1 +} + +load_rc_config $name +run_rc_command "$1"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504290959.t3T9xHZI035637>