From owner-freebsd-isp@FreeBSD.ORG Thu Jun 12 10:17:07 2003 Return-Path: Delivered-To: freebsd-isp@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2FDEF37B401 for ; Thu, 12 Jun 2003 10:17:07 -0700 (PDT) Received: from hexagon.stack.nl (hexagon.stack.nl [131.155.140.144]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3EE5343FB1 for ; Thu, 12 Jun 2003 10:17:06 -0700 (PDT) (envelope-from dean@dragon.stack.nl) Received: by hexagon.stack.nl (Postfix, from userid 65534) id 23E461C4C; Thu, 12 Jun 2003 19:17:05 +0200 (CEST) Received: from dragon.stack.nl (dragon.stack.nl [2001:610:1108:5011:207:e9ff:fe09:230]) by hexagon.stack.nl (Postfix) with ESMTP id D59B51C38; Thu, 12 Jun 2003 19:17:00 +0200 (CEST) Received: by dragon.stack.nl (Postfix, from userid 1600) id CC2465F187; Thu, 12 Jun 2003 19:17:00 +0200 (CEST) Date: Thu, 12 Jun 2003 19:17:00 +0200 From: Dean Strik To: "PsYxAkIaS (FreeBSD)" Message-ID: <20030612171700.GA64585@dragon.stack.nl> References: <000a01c33105$8e4e4ec0$152ea8c0@computer> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000a01c33105$8e4e4ec0$152ea8c0@computer> X-Editor: VIM Rulez! http://www.vim.org/ X-MUD: Outerspace - telnet://mud.stack.nl:3333 X-Really: Yes User-Agent: Mutt/1.5.4i X-Spam-Status: No, hits=-32.5 required=5.0 tests=EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_MUTT version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) cc: freebsd-isp@freebsd.org Subject: Re: cannot reboot from a script ran by root's crontab X-BeenThere: freebsd-isp@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Internet Services Providers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2003 17:17:07 -0000 PsYxAkIaS (FreeBSD) wrote: > Hello > > $ cat /usr/sbin/checkre > #!/bin/bash You have a /bin/bash? Use /bin/sh instad. > mkdir /tmp/reboot > reboot now > $ crontab -l 0,5,10,15,20,25,30,35,40,45,50,55 * * * * > /usr/sbin/checkre >/dev/null 2>&1 > > $ whoami root > > when the time comes, it makes the directory /tmp/reboot but it doesnt > 'reboot now'. > > > Is this a security issue that forbids FreeBSD to reboot from a script > running by root's crontab? if yes, how can i bypass it? The reboot binary is in /sbin. Which is not in your PATH. Either set PATH in the crontab, or edit the checkre script to use /sbin/reboot instead. Root should have the errors in it's mail btw... -- Dean C. Strik Eindhoven University of Technology dean@stack.nl | dean@ipnet6.org | http://www.ipnet6.org/ "This isn't right. This isn't even wrong." -- Wolfgang Pauli