From owner-freebsd-ports@FreeBSD.ORG Fri Jul 18 21:21:55 2014 Return-Path: Delivered-To: freebsd-ports@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 295A0649; Fri, 18 Jul 2014 21:21:55 +0000 (UTC) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) (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 186D520A9; Fri, 18 Jul 2014 21:21:53 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id d1so1477833wiv.13 for ; Fri, 18 Jul 2014 14:21:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=N/VkkIaEpJpK/p0gk61pHvdNpop46N0RrQj9a+X5P84=; b=qdhUTJ1PtiQgFzI1ivrKJE8v4gOvCl8REAiFzODddcJFu2DQhJVqmhru0NhxiXcJXt HFUBHs4XoduKPhGpv3ICNeQ+bNtj+IgZ0Y4KW0Y/uR2gqcWQUrPAiuU8Z2kMOdbl4G0C a3lge54a0R8rxz9MEGO6haOrwNX8q+IyddD+SgWMRoGhYcRYoT0BN0Lr9BSa7OeosKKr W+/+LGFUXEju2VapEftGVbtM1kr/hz5ac7bY1gHpWSfHCb+kTBUIM7Xu4PqLTKs/jwZK mEGrQQj5dU0WmQ7ruD4onMDTnPUc0yQ+LuA7Ol4pzhZGmxUnUCRO/M3qy0tHjFh3YoY0 B55A== X-Received: by 10.180.20.206 with SMTP id p14mr11733872wie.26.1405718512442; Fri, 18 Jul 2014 14:21:52 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id fs17sm16982466wjc.6.2014.07.18.14.21.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jul 2014 14:21:51 -0700 (PDT) Sender: Baptiste Daroussin Date: Fri, 18 Jul 2014 23:21:49 +0200 From: Baptiste Daroussin To: Adrian Chadd Subject: Re: HOWTO articles for migrating from Linux to FreeBSD, especially for pkg? Message-ID: <20140718212148.GQ28314@ivaldir.etoilebsd.net> References: <53C82EC4.8060304@gmail.com> <20140718142835.GF96250@e-new.0x20.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xYeFQzU4VZLrHqxU" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) 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: Fri, 18 Jul 2014 21:21:55 -0000 --xYeFQzU4VZLrHqxU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 18, 2014 at 12:10:34PM -0700, Adrian Chadd wrote: > Hi! >=20 >=20 > 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 w= rote: > >> > >> > 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=3D"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=3DY= ES" > > 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! >=20 > 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. >=20 > "Oh, hm, I'd like to know what options there are for controlling the > installed apache24 package, let's see"... >=20 > 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. >=20 you are asking for rcng2 with a declarative init config rather the a script regards, Bapt --xYeFQzU4VZLrHqxU Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlPJj+wACgkQ8kTtMUmk6Ex4tACgwKYEzgQEnkf4EF+nQJCC/1aO 3rYAmgOybC0HkT5geVYIRrn0qst0HliY =Y8tG -----END PGP SIGNATURE----- --xYeFQzU4VZLrHqxU--