From owner-freebsd-questions@FreeBSD.ORG Fri Jan 6 18:02:19 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 621BF16A420 for ; Fri, 6 Jan 2006 18:02:19 +0000 (GMT) (envelope-from rihad@mail.ru) Received: from mx1.mail.ru (mx1.mail.ru [194.67.23.121]) by mx1.FreeBSD.org (Postfix) with ESMTP id E034443D49 for ; Fri, 6 Jan 2006 18:02:17 +0000 (GMT) (envelope-from rihad@mail.ru) Received: from [62.212.229.11] (port=37346 helo=[62.212.229.11]) by mx1.mail.ru with esmtp id 1Euvuq-000GCo-00 for freebsd-questions@freebsd.org; Fri, 06 Jan 2006 21:02:16 +0300 Message-ID: <43BEB0A9.1030101@mail.ru> Date: Fri, 06 Jan 2006 22:02:17 +0400 From: rihad User-Agent: Debian Thunderbird 1.0.2 (X11/20051002) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: rcNG shutdown X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2006 18:02:19 -0000 Hi. I can't seem to find the way FreeBSD deals with stopping the running rc.d services when shutting down/rebooting the machine. In Linux, for example, the shutdown command first switches to "runlevel" 0, triggering init to call the program for that event, which deals with shutting down the running services gracefully. I might be missing something obvious: in FreeBSD, are users expected to write their own programs for doing that? Something along the lines of (untested): find /usr/local/etc/rc.d/ /etc/rc.d/ -mindepth 2 -print0 \ | xargs -0 -n1 -I% /usr/bin/command "%" stop halt -p|reboot|whatever ?