From owner-freebsd-questions@FreeBSD.ORG Thu Jul 8 10:57:51 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A2481065670 for ; Thu, 8 Jul 2010 10:57:51 +0000 (UTC) (envelope-from freebsd@optimis.net) Received: from mail.optimis.net (mail.optimis.net [69.104.191.124]) by mx1.freebsd.org (Postfix) with ESMTP id 2998C8FC1A for ; Thu, 8 Jul 2010 10:57:50 +0000 (UTC) Received: from marvin.optimis.net (marvin.optimis.net [192.168.1.3]) by mail.optimis.net (8.14.3/8.14.3) with ESMTP id o68AvnPe088313 for ; Thu, 8 Jul 2010 03:57:50 -0700 (PDT) (envelope-from freebsd@optimis.net) Received: from marvin.optimis.net (localhost [127.0.0.1]) by marvin.optimis.net (8.14.3/8.14.3) with ESMTP id o68Avo95036859; Thu, 8 Jul 2010 03:57:50 -0700 (PDT) (envelope-from freebsd@optimis.net) Received: (from george@localhost) by marvin.optimis.net (8.14.3/8.14.3/Submit) id o68AvoRq036858; Thu, 8 Jul 2010 03:57:50 -0700 (PDT) (envelope-from freebsd@optimis.net) Date: Thu, 8 Jul 2010 03:57:49 -0700 From: George Davidovich To: freebsd-questions@freebsd.org Message-ID: <20100708105749.GA34771@marvin.optimis.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) Subject: Re: [6.3] Get e-mail when CTRL-ALT-DEL is used? 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: Thu, 08 Jul 2010 10:57:51 -0000 On Thu, Jul 08, 2010 at 12:12:27PM +0200, Gilles wrote: > This is on a remote 6.3 host: I'd like to get an e-mail if a user hits > the CTRL-ALT-DEL to reboot the server. > > Googling told me that the use of the three-key combo can be > enabled/disabled when compiling a new kernel, but not how to manage > this feature when it's enabled in a running kernel. > > Is there a configuration file somewhere that would let me add e-mail > support for this action? Assuming you want to know whether the server was rebooted (as opposed to whether a user invoked a given key combination), adding something along the lines of the following to root's crontab(5) should suffice: @reboot echo "`hostname` rebooted" \ | mail -s "`hostname` rebooted" gilles@example.org -- George