From owner-freebsd-ports@FreeBSD.ORG Sat Jul 19 00:31:28 2014 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72A89A5A; Sat, 19 Jul 2014 00:31:28 +0000 (UTC) Received: from mail-qa0-x233.google.com (mail-qa0-x233.google.com [IPv6:2607:f8b0:400d:c00::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE5F120D6; Sat, 19 Jul 2014 00:31:27 +0000 (UTC) Received: by mail-qa0-f51.google.com with SMTP id k15so3563503qaq.10 for ; Fri, 18 Jul 2014 17:31:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=BBCKzrCPhal2XonLLPLlxcw0JjxUA869/laU5El57DI=; b=oRp/Y1fD1OnT+QtA760jXkfDHGqcDI5kTXoY2PG56UuwwSTngS2MaCYr4GktnfXfkq jb1wonGqZC13IgqTlqZPwg90RCw2wNsi7iDE6XZGzSUlGMH386w53HR05vcWZm69c/iL Ytmgb+MBG4/qM1TpIfhCx3dhLo0jq5c8a0e004O14PRKy/5nFbYj8EGbiAUjnlUJfVIF E3wjBfFxs5wkU2w0JfNIFRXF0FXW3B2zCzHmv7uBD6uqiZjJFmb+TZB6/NFrz77vFGfp nbanzzae8j3FZWKKsUcMcfBPJAGl9gz8uiLnapRWOmPxX9bkGGX6NRsKEbxz7w5ZveIz PkQg== MIME-Version: 1.0 X-Received: by 10.229.226.135 with SMTP id iw7mr13976530qcb.13.1405729887034; Fri, 18 Jul 2014 17:31:27 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.1.6 with HTTP; Fri, 18 Jul 2014 17:31:26 -0700 (PDT) In-Reply-To: <20140718212148.GQ28314@ivaldir.etoilebsd.net> References: <53C82EC4.8060304@gmail.com> <20140718142835.GF96250@e-new.0x20.net> <20140718212148.GQ28314@ivaldir.etoilebsd.net> Date: Fri, 18 Jul 2014 17:31:26 -0700 X-Google-Sender-Auth: eK1PH_VkG9hmkvssz8TNhgCL6xY Message-ID: Subject: Re: HOWTO articles for migrating from Linux to FreeBSD, especially for pkg? From: Adrian Chadd To: Baptiste Daroussin Content-Type: text/plain; charset=UTF-8 Cc: Craig Rodrigues , Lars Engels , freebsd-doc@freebsd.org, Alberto Mijares , freebsd-current Current , Andreas Nilsson , Navdeep Parhar , ports X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 00:31:28 -0000 On 18 July 2014 14:21, Baptiste Daroussin wrote: > On Fri, Jul 18, 2014 at 12:10:34PM -0700, Adrian Chadd wrote: >> Hi! >> >> >> On 18 July 2014 07:28, Lars Engels wrote: >> > On Thu, Jul 17, 2014 at 10:21:17PM +0200, Andreas Nilsson wrote: >> >> On Thu, Jul 17, 2014 at 10:15 PM, Navdeep Parhar wrote: >> >> >> >> > On 07/17/14 13:12, Adrian Chadd wrote: >> >> > > On 17 July 2014 13:03, Alberto Mijares wrote: >> >> > >> On Thu, Jul 17, 2014 at 2:58 PM, Adrian Chadd >> >> > wrote: >> >> > >>> Hi! >> >> > >>> >> >> > >>> 3) The binary packages need to work out of the box >> >> > >>> 4) .. which means, when you do things like pkg install apache, it >> >> > >>> can't just be installed and not be enabled, because that's a bit of a >> >> > >>> problem; >> >> > >> >> >> > >> >> >> > >> No. Please NEVER do that! The user must be able to edit the files and >> >> > >> start the service by himself. >> >> > > >> >> > > Cool, so what's the single line command needed to type in to start a >> >> > > given package service? >> >> > >> >> > Aren't sysrc(8) and service(8) for this kind of stuff? >> >> > >> >> >> >> They sure are. >> >> >> >> Well, pkg install $service ; sysrc ${service}_enable="YES" would do. >> >> Although some services have different names than the packge, which is sort >> >> of annoying. >> > >> > I hacked up a solution for service(8): >> > >> > http://bsd-geek.de/FreeBSD/service.sh.enable-disable.patch >> > >> > The patch adds the following directives to service(8): >> > >> > enable: Grabs an rc script's rcvar value and runs "sysrc foo_enable=YES" >> > disable: The opposite of enable >> > rcdelete: Deletes an rc script's rcvar value from /etc/rc.conf using >> > "sysrc -x foo_enable" >> > >> > The nice thing about is that you can use one of the new directives on >> > one line with the old ones, as long as the new are the first argument: >> > >> > # service syslogd enable >> > # service apache24 disable stop >> > # service apache24 rcdelete stop >> > # service nginx enable start >> > >> > >> > So after installing a package, to start and enable a daemon permanently >> > all you have to run is >> > # service foo enable start >> > >> > Lars >> > >> > P.S.: Thansk to Devin for his hard work on sysrc! >> >> Having a way for sysrc and service to know what particular options and >> services are exposed by a given package or installed "thing" would be >> nice. Right now the namespace is very flat and it's not obvious in all >> instances what needs to happen to make it useful and what the options >> are. >> >> "Oh, hm, I'd like to know what options there are for controlling the >> installed apache24 package, let's see"... >> >> I remember IRIX having that command to list services, stop them and >> start them, configure them enabled and disabled. Solaris grew >> something like that with Solaris 10 and after the initial learning >> curve it was great. Hving something like that would be 100% awesome. >> > you are asking for rcng2 with a declarative init config rather the a script It can be a series of scripts. The problem is that the namespace for options has nothing else attached, like "Hi I'm an option that starts/stops a service", "Hi I'm an option that's for this package", "Hi I'm an option that's for this class of things." Right now there's just a series of shell variables with educated guesses about what package they're related to and what they do, rather than anything that specifically says what they do. -a