From patchwork Fri Oct 19 21:08:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 192808 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "acsinet15.oracle.com", Issuer "VeriSign Class 3 International Server CA - G3" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 54F682C0090 for ; Sat, 20 Oct 2012 08:08:11 +1100 (EST) Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q9JL87bp011917 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 19 Oct 2012 21:08:07 GMT Received: from oss.oracle.com (oss-external.oracle.com [137.254.96.51]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q9JL8673029790 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 19 Oct 2012 21:08:06 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1TPJna-0007GX-LL; Fri, 19 Oct 2012 14:08:06 -0700 Received: from acsinet22.oracle.com ([141.146.126.238]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1TPJnY-0007GK-Pl for fedfs-utils-devel@oss.oracle.com; Fri, 19 Oct 2012 14:08:04 -0700 Received: from rcsinet12.oracle.com (rcsinet12.oracle.com [148.87.113.124]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q9JL84SL004362 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 19 Oct 2012 21:08:04 GMT Received: from mail-ie0-f171.google.com (mail-ie0-f171.google.com [209.85.223.171]) by rcsinet12.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q9JL7mRu028318 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Fri, 19 Oct 2012 21:08:03 GMT Received: by mail-ie0-f171.google.com with SMTP id s9so1361610iec.2 for ; Fri, 19 Oct 2012 14:08:03 -0700 (PDT) Received: by 10.50.46.226 with SMTP id y2mr2767682igm.62.1350680883402; Fri, 19 Oct 2012 14:08:03 -0700 (PDT) Received: from seurat.1015granger.net (adsl-99-26-161-222.dsl.sfldmi.sbcglobal.net. [99.26.161.222]) by mx.google.com with ESMTPS id d19sm16668986igp.6.2012.10.19.14.08.02 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 19 Oct 2012 14:08:03 -0700 (PDT) From: Chuck Lever To: fedfs-utils-devel@oss.oracle.com Date: Fri, 19 Oct 2012 17:08:02 -0400 Message-ID: <20121019210802.53119.90861.stgit@seurat.1015granger.net> In-Reply-To: <20121019210357.53119.28925.stgit@seurat.1015granger.net> References: <20121019210357.53119.28925.stgit@seurat.1015granger.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Flow-Control-Info: class=Default reputation=ipRepBelow100 ip=209.85.223.171 ct-class=R5 ct-vol1=-97 ct-vol2=9 ct-vol3=8 ct-risk=49 ct-spam1=78 ct-spam2=8 ct-bulk=6 rcpts=1 size=645 X-MM-CT-Classification: not spam X-MM-CT-RefID: str=0001.0A090209.5081C133.010D,ss=1,re=0.000,fgs=0 Subject: [fedfs-utils] [PATCH 03/11] fedfsd: Change the working directory to the default state dir X-BeenThere: fedfs-utils-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list Reply-To: fedfs-utils Developers List-Id: fedfs-utils Developers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: fedfs-utils-devel-bounces@oss.oracle.com Errors-To: fedfs-utils-devel-bounces@oss.oracle.com X-Source-IP: acsinet21.oracle.com [141.146.126.237] Follow conventional practice of other RPC service daemons. Signed-off-by: Chuck Lever --- src/fedfsd/main.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/fedfsd/main.c b/src/fedfsd/main.c index f0a39d6..fd6bee5 100644 --- a/src/fedfsd/main.c +++ b/src/fedfsd/main.c @@ -219,6 +219,10 @@ int main(int argc, char **argv) exit(EXIT_FAILURE); if (!foreground) { + if (chdir(FEDFS_DEFAULT_STATEDIR) == -1) { + xlog(L_ERROR, "chdir: %m"); + exit(EXIT_FAILURE); + } if (daemon(0, 0) == -1) { xlog(L_ERROR, "daemon: %m"); exit(EXIT_FAILURE);