From owner-freebsd-questions@FreeBSD.ORG Tue Dec 3 17:41:29 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09D805BE for ; Tue, 3 Dec 2013 17:41:29 +0000 (UTC) Received: from nm39.bullet.mail.ne1.yahoo.com (nm39.bullet.mail.ne1.yahoo.com [98.138.229.32]) by mx1.freebsd.org (Postfix) with SMTP id AD8DD14D0 for ; Tue, 3 Dec 2013 17:41:28 +0000 (UTC) Received: from [127.0.0.1] by nm39.bullet.mail.ne1.yahoo.com with NNFMP; 03 Dec 2013 17:41:22 -0000 Received: from [98.138.100.118] by nm39.bullet.mail.ne1.yahoo.com with NNFMP; 03 Dec 2013 17:38:34 -0000 Received: from [98.139.212.207] by tm109.bullet.mail.ne1.yahoo.com with NNFMP; 03 Dec 2013 17:38:34 -0000 Received: from [127.0.0.1] by omp1016.mail.bf1.yahoo.com with NNFMP; 03 Dec 2013 17:38:34 -0000 X-Yahoo-Newman-Property: ymail-4 X-Yahoo-Newman-Id: 382245.25939.bm@omp1016.mail.bf1.yahoo.com Received: (qmail 4923 invoked by uid 60001); 3 Dec 2013 17:38:34 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1386092314; bh=9iEQuglUTXRkL0TLy6M0h7wuPhXFtxsgwhJepXQS72Y=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=tUD7Uj32Zc7mCqyTm/eg3Q7W554NrDWJoa4l2aBZtEO+BNzLyuMbAwBy1NndKhkVxtFOfKUk+0I3V5pzl9nAWT6XbTq49USg2EK3HBgb+vq4qYtUPeOlYDfobBwi+eVksN01DqS2GvFv7qIn0r2s/UPK3ePagz572VYG+5eqBd8= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=YAUScde6nnyGI1gSz+XtaR6cJUQBtzMOyXxmIJchbaSvQlpOdZQsYWxO7kdLvwQcAPIZhFyiksIkrDRNWyivJhvCu/UmS5/nHcEe2ZOqbKjICoJM2RWpxmG1XfuStRYFTd7lDFi9Xk3DlBJA+ln8dM2f8mu/BUsohmuH7eaH910=; X-YMail-OSG: QLRxeQ8VM1nfWtkrS7szK15uMdxHlWUCSefwedhr40Vkn.a SDMbdUGFnKe6cf06A9fcmwg4mk5s2lTNSfG958uegUdheAAGwZAUUtXXlf91 epJeiBbgt5WiEn.cp5xa3y_PgGIfj0uRJReqLVhn3Ln0CjaEYLaKgpU3GkOb H7uNMDmEpTXHHlEgNn5lKsRYYMOqa2w2F5atvJvwbkKwHIFrJw9DP0JoEQyf si.lF2jkmo48H7VRusTmY5tlHd2QMHMx91bTZIKCRgMRcaE8me1D707wPU1a XfKG2XjNu8zkQTYz6sA2l.OZ4_elbYRybzTqYwfAVLUEJnz4U89srE_pNDqD layPJh3p5gNTlkiTPJL_1TTOyNY99OvZ6TJrCYvdKTuEu_bzOSgz4EincJ91 sk6Sj7JxtDY8P7y4RICj3f2Lb4ftoj8.W04CVb_ljVF36PD.cxfii55sJ22E Drz2TOP3NJo0Z03NwTueQDBaLJpIhBY8yfckHyxFqMhQyq9Ybmwgmee8AIH4 ayA.HoQC01JYmQZaKI0MT1OyIVn.eJBF5MfHjDSg7MqA9St3EOOHUGxRPP.P 2RtLzfj5VMVgpgDA_hBFdqZN.fEuXxGKDKxfK3Um.vtPRgj.OmVxH8BDxCr3 AJURxnESTgP.8skkXHA-- Received: from [124.43.130.109] by web161904.mail.bf1.yahoo.com via HTTP; Tue, 03 Dec 2013 09:38:34 PST X-Rocket-MIMEInfo: 002.001, SGkKCkRyLiBELiBKLiBCZXJuc3RlaW4gc2F5cyAiSGF2aW5nIGV2ZXJ5IGRhZW1vbiBwdXQgaXRzZWxmIGludG8gdGhlIGJhY2tncm91bmQKaXMgYmFkIHNvZnR3YXJlIGRlc2lnbi4iIGluIGh0dHA6Ly9jci55cC50by9kYWVtb250b29scy9mYXEvY3JlYXRlLmh0bWwgLgoKVGhhdCBpcywgaXMgaXQgcG9zc2libGUgdG8gd3JpdGUgYSBkYWVtb24gdG8gcnVuIGluIGZvcmVncm91bmQgYW5kIGF1dG9tYXRpY2FsbHkgc3RhcnRlZCBhdCBzeXN0ZW0gYm9vdCB1cCAodmlhIC9ldGMvcmMuY29uZik_CgpDYW4gc28BMAEBAQE- X-Mailer: YahooMailWebService/0.8.167.602 Message-ID: <1386092314.98211.YahooMailNeo@web161904.mail.bf1.yahoo.com> Date: Tue, 3 Dec 2013 09:38:34 -0800 (PST) From: Unga Subject: Having every daemon put itself into the background is bad software design To: "freebsd-questions@freebsd.org" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Content-Filtered-By: Mailman/MimeDel 2.1.17 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Unga List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Dec 2013 17:41:29 -0000 Hi Dr. D. J. Bernstein says "Having every daemon put itself into the background is bad software design." in http://cr.yp.to/daemontools/faq/create.html . That is, is it possible to write a daemon to run in foreground and automatically started at system boot up (via /etc/rc.conf)? Can someone provide a sample in C? Does he means after fork(2), the parent continue to run? Can such a program started via the /etc/rc.conf without a terminal attached? Any idea? Btw, I got in to this problem by trying to use DJB's daemontools to supervise my server running on FreeBSD. But it creates zombie processes and spawn quite fast. In my daemons, after fork(2), parent returns. Best regards Unga From owner-freebsd-questions@FreeBSD.ORG Tue Dec 3 17:46:41 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 56B11729 for ; Tue, 3 Dec 2013 17:46:41 +0000 (UTC) Received: from mail-oa0-x22e.google.com (mail-oa0-x22e.google.com [IPv6:2607:f8b0:4003:c02::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 209CE1511 for ; Tue, 3 Dec 2013 17:46:41 +0000 (UTC) Received: by mail-oa0-f46.google.com with SMTP id o6so15189948oag.5 for ; Tue, 03 Dec 2013 09:46:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=WFIkhmARo2Mh/vw7pxXapoNxJhYSBR+XV/zBMbPrQ3U=; b=s8CXV2fl7nIbXKM4OKCIcSOZFr4MKfWjNQrBEJKxnftr/vKgouccFqY441t/HEhlfo 5s7XihQtsFgL/VbXyA5uSZe/pLXPikwzr5SZ3FcBDwyUrLfFqvgb+n08nhuJi2V3qfH/ 9IMV7VaPqYwLeAIYzpLLx+HvIRP9q/ubBkJvXX60LINCTqOecQ/hGCK0V/T09DbmezCK 4jDVrgSfSVG8y9CFK4XKI70+Bye22Ge9V5NHVWvQFcJmV++vPh3tp4YRT7kG31sANDqg i7BjvLjUzAHtWKhS3RNFNwesYDc/pcxQNjYbcEZ25GGAuEZ1wV/kkxhr19PFF75nxXFt 6RFw== MIME-Version: 1.0 X-Received: by 10.60.134.14 with SMTP id pg14mr1920419oeb.66.1386092800196; Tue, 03 Dec 2013 09:46:40 -0800 (PST) Received: by 10.182.139.9 with HTTP; Tue, 3 Dec 2013 09:46:40 -0800 (PST) In-Reply-To: <44r49tg8uv.fsf@lowell-desk.lan> References: <44r49tg8uv.fsf@lowell-desk.lan> Date: Wed, 4 Dec 2013 02:46:40 +0900 Message-ID: Subject: Re: local ports collection From: till plewe To: FreeBSD-Questions Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Dec 2013 17:46:41 -0000 Thanks for the answer. DESTDIR was supposed to be DISTDIR (typo). Setting SU_CMD was the hint I needed. Now it seems adjusting ldconfig is the only thing left to do. pkg installed without problems. On Wed, Dec 4, 2013 at 2:08 AM, Lowell Gilbert wrote: > till plewe writes: > >> I would like to use the ports tree to install and manage packages inside my >> home directory. I tried setting: >> >> PKG_DBDIR,PREFIX,PORTSDIR,LOCALBASE,PORT_DBDIR,DESTDIR > > Don't use DESTDIR; it doesn't do what you think it does. > [What did you think it did anyway, and why?] > >> to directories within my home directory but then I get error messages like >> >> $ make build >> ===> Creating some important subdirectories >> mount_nullfs: Operation not permitted >> >> when trying to build/install ports. >> >> Any suggestions on how to use ports completely avoiding root? >> (I rented space on a server and have permission to install binaries >> but do not have root access) > > You'll probably have to change SU_CMD as well. > Something like "su $USER -c" should do it. > And you may need to bootstrap the pkg(8) command somehow. > > Good luck.