From owner-freebsd-questions@FreeBSD.ORG Thu Nov 11 08:56:09 2004 Return-Path: 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 62D4316A4CE for ; Thu, 11 Nov 2004 08:56:09 +0000 (GMT) Received: from mail.u4eatech.com (blackhole.u4eatech.com [195.188.241.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 73D9843D49 for ; Thu, 11 Nov 2004 08:56:08 +0000 (GMT) (envelope-from richard.williamson@u4eatech.com) Received: by mail.u4eatech.com (Postfix, from userid 503) id BB61D3600AF; Thu, 11 Nov 2004 08:56:06 +0000 (GMT) Received: from crater.u4eatech.com (mir.degree2.com [172.30.40.201]) by mail.u4eatech.com (Postfix) with ESMTP id 432F6360037 for ; Thu, 11 Nov 2004 08:56:03 +0000 (GMT) Message-Id: <6.1.2.0.2.20041111084142.0266f138@cygnus> X-Sender: richard@cygnus (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 6.1.2.0 Date: Thu, 11 Nov 2004 08:56:04 +0000 To: freebsd-questions@freebsd.org From: Richard Williamson Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on mail X-Spam-Level: X-Spam-Status: No, hits=-4.9 required=5.0 tests=BAYES_00 autolearn=ham version=2.64 Subject: sh pain (cl vs execve) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2004 08:56:09 -0000 Hello the list, I've got a sh script that updates a group of files in non-volatile storage from versions in the root filesystem (at /dev/md0 if that is important), if the files in ram are more up-to-date. Easy enough in theory. If I call the sh script from the command line it works as expected. If the script is called using execve from inside some code, the script completes, however the data is not updated in flash. Output from syslog: 1 Feb 14 01:37:58 RDP checkSettings: start 2 Feb 14 01:37:58 RDP checkSettings: diffs in currentconfig 3 Feb 14 01:37:58 RDP : CheckAndAutosave status: 1 4 Feb 14 01:37:58 RDP saveSettings: done lines 1 and 2 are the result of a call to /scripts/checkSettings. This returns 1 if any file in a discrete list is found to differ between that which is in memory and that which is in the flash. line 3 is the code reporting that checkSettings returned 1 when called via execve(). line 4 is the result of a call to /scripts/saveSettings, saying that it had done its job and that all files in flash were now up to date. Sadly: RDP 18:03 [~] rip>diff /settings/currentconfig /init/settings/currentconfig 1c1 < 2 --- > 1 RDP 18:03 [~] rip> This is clearly not the case. RDP 18:03 [~] rip>/scripts/saveSettings RDP 18:04 [~] rip>!diff diff /settings/currentconfig /init/settings/currentconfig RDP 18:04 [~] rip> What am I missing? I've checked things like permissions (the code is being run by user root, the files and directories on /init are all owned by root). What else? tia, rip