From e32d4e2d39e2dc4e00255b92fe2284a2967c1d88 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 2 Mar 2005 12:14:47 +0000 Subject: [PATCH] Unconfigure cgd devices on shutdown, so that underlying layers (i.e., RAIDframe) are happier. --- etc/rc.d/cgd | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/etc/rc.d/cgd b/etc/rc.d/cgd index 4606140ad42f..4963e8323410 100755 --- a/etc/rc.d/cgd +++ b/etc/rc.d/cgd @@ -1,16 +1,17 @@ #!/bin/sh # -# $NetBSD: cgd,v 1.3 2004/08/13 18:08:03 mycroft Exp $ +# $NetBSD: cgd,v 1.4 2005/03/02 12:14:47 tv Exp $ # # PROVIDE: disks +# KEYWORD: shutdown $_rc_subr_loaded . /etc/rc.subr name="cgd" rcvar=$name start_cmd="cgd_start" -stop_cmd=":" +stop_cmd="cgd_stop" cgd_start() { @@ -20,5 +21,13 @@ cgd_start() fi } +cgd_stop() +{ + if [ -f /etc/cgd/cgd.conf ]; then + echo "Unconfiguring CGD devices." + cgdconfig -U + fi +} + load_rc_config $name run_rc_command "$1"