From owner-freebsd-doc@FreeBSD.ORG Fri Jul 18 12:14:21 2014 Return-Path: Delivered-To: freebsd-doc@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 754B84ED; Fri, 18 Jul 2014 12:14:21 +0000 (UTC) Received: from mail.0x20.net (mail.0x20.net [217.69.76.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7BBC2CBE; Fri, 18 Jul 2014 12:14:20 +0000 (UTC) Received: from e-new.0x20.net (mail.0x20.net [IPv6:2001:aa8:fffb:1::3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.0x20.net (Postfix) with ESMTPS id 223936A6032; Fri, 18 Jul 2014 14:14:18 +0200 (CEST) Received: from e-new.0x20.net (localhost [127.0.0.1]) by e-new.0x20.net (8.14.7/8.14.7) with ESMTP id s6ICEHE2044071; Fri, 18 Jul 2014 14:14:17 +0200 (CEST) (envelope-from lars@e-new.0x20.net) Received: (from lars@localhost) by e-new.0x20.net (8.14.7/8.14.7/Submit) id s6ICEHjp042859; Fri, 18 Jul 2014 14:14:17 +0200 (CEST) (envelope-from lars) Date: Fri, 18 Jul 2014 14:14:17 +0200 From: Lars Engels To: Adrian Chadd , Andreas Nilsson , Craig Rodrigues , freebsd-doc@freebsd.org, freebsd-current Current , ports Subject: Re: HOWTO articles for migrating from Linux to FreeBSD, especially for pkg? Message-ID: <20140718121417.GE96250@e-new.0x20.net> Mail-Followup-To: Lars Engels , Adrian Chadd , Andreas Nilsson , Craig Rodrigues , freebsd-doc@freebsd.org, freebsd-current Current , ports References: <20140718121025.GD96250@e-new.0x20.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="X3gaHHMYHkYqP6yf" Content-Disposition: inline In-Reply-To: <20140718121025.GD96250@e-new.0x20.net> X-Editor: VIM - Vi IMproved 7.4 X-Operation-System: FreeBSD 8.4-RELEASE-p4 User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 12:14:21 -0000 --X3gaHHMYHkYqP6yf Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 18, 2014 at 02:10:25PM +0200, Lars Engels wrote: > On Thu, Jul 17, 2014 at 01:00:03PM -0700, Adrian Chadd wrote: > > On 17 July 2014 12:57, Andreas Nilsson wrote: > > > > > > > > > > > > On Thu, Jul 17, 2014 at 9:28 PM, Adrian Chadd wr= ote: > > >> > > >> 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; > > > > > > I disagree on this. For network services on linux ( apart from ssh ),= I want > > > that started very seldom. But I do want the package installed so that= when I > > > need it, it is there. Having it autostart as part of being installed = is > > > breaking KISS and in some way unix philosophy: I asked for something = to be > > > installed, not installed and autostarted. > >=20 > > That's cool. We can disagree on that. But the fact that you have to > > edit a file to enable things and hope you get the right start entry in > > /etc/rc.conf or /usr/local/etc/rc.conf, or wherever you put it is, is > > a pain. >=20 > No, Sir! No need to edit anything: >=20 > root@testjail: # pkg install apache24 > Updating repository catalogue > The following 5 packages will be installed: >=20 > Installing pcre: 8.33 > Installing gdbm: 1.10 > Installing db42: 4.2.52_5 > Installing apr: 1.4.8.1.5.3 > Installing apache24: 2.4.6_1 >=20 > The installation will require 47 MB more space >=20 > 5 MB to be downloaded >=20 > Proceed with installing packages [y/N]: y > gdbm-1.10.txz 100% 83KB 83.2KB/s 83.2KB/s 00:00 > db42-4.2.52_5.txz 100% 1457KB 1.4MB/s 1.4MB/s 00:00 > apr-1.4.8.1.5.3.txz 100% 390KB 389.5KB/s 389.5KB/s 00:00 > apache24-2.4.6_1.txz 100% 3649KB 3.6MB/s 3.6MB/s 00:00 > Checking integrity... done > [1/5] Installing pcre-8.33... done > [2/5] Installing gdbm-1.10... done > [3/5] Installing db42-4.2.52_5... done > [4/5] Installing apr-1.4.8.1.5.3... done > [5/5] Installing apache24-2.4.6_1...=3D=3D=3D> Creating users and/or grou= ps. > Using existing group 'www'. > Using existing user 'www'. > /usr/local/share/examples/apache24/httpd.conf -> > /usr/local/etc/apache24/httpd.conf > done > To run apache www server from startup, add apache24_enable=3D"yes" > in your /etc/rc.conf. Extra options can be found in startup script. >=20 > Your hostname must be resolvable using at least 1 mechanism in > /etc/nsswitch.conf typically DNS or /etc/hosts or apache might > have issues starting depending on the modules you are using. >=20 > root@testjail: # sysrc apache24_enable=3Dyes > apache24_enable: -> yes >=20 > root@testjail: # service apache24 start > Performing sanity check on apache24 configuration: > AH00557: httpd: apr_sockaddr_info_get() failed for testjail > AH00558: httpd: Could not reliably determine the server's fully > qualified domain name, using 127.0.0.1. Set the 'ServerName' directive > globally to suppress this message > Syntax OK > Starting apache24. > AH00557: httpd: apr_sockaddr_info_get() failed for testjail > AH00558: httpd: Could not reliably determine the server's fully > qualified domain name, using 127.0.0.1. Set the 'ServerName' directive > globally to suppress this message > root@testjail: # >=20 >=20 > That's 3 commands to enter. Admittedly 2 more than on some OS that > blindly starts any service you install, but 2 steps more logical and > even a newbie can do this. >=20 > What could be done is that pkg looks for rc scripts in a package, > extracts the enable line and prints a message how to enable the script / > daemon permanently. >=20 > Like:=20 > - To start the script "apache24" once run "service apache24 onestart". > - To start the script "apache24" at boot time run "sysrc apache24_enable= =3Dyes" > - The script "apache24" has the following optional settings for /etc/rc.c= onf: > apache24_profiles (str): Set to "" by default. > Define your profiles here. > apache24limits_enable (bool):Set to "NO" by default. > Set it to yes to run `limits $limits_args` > just before apache starts. > apache24_flags (str): Set to "" by default. > Extra flags passed to start command. > apache24limits_args (str): Default to "-e -C daemon" > Arguments of pre-start limits run. > apache24_http_accept_enable (bool): Set to "NO" by default. > Set to yes to check for accf_http kernel > module on start up and load if not loaded. > apache24_fib (str): Set an altered default network view for a= pache >=20 >=20 >=20 Sorry for no reading the whole thread first. This was already suggested in another part of the thread. --X3gaHHMYHkYqP6yf Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQF7BAEBCgBmBQJTyQ+ZXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ4RjQwMDE3RTRERjUzMTI1N0FGRTUxNDlF NTRDQjM3RDNBMDg5RDZEAAoJEOVMs306CJ1tYnQH92Fryi0AK/TnLdIfoYHluYJl TSDKYXMsq/DNhWQdTwDOLwU1GyUFnjvLm5RVvyODo6RIT4EnqH3hnOBJ9O/J5DFV T8/EiV863j+j6rKmwG/pzygM7JYy9T7cZEZBBj6tm8CSYZSOdbaCtSLeyof7z0EW NhNVISs5mqfGETTtnfLdRyRvYCqadpd691v2sgzus6ziCAo6f1DgA/PbM4sG7HRW 8DJW5xdSzV6kqZ24DbbvSiZVFzz1efpGbFKOgH27lpJglgqDzyK0gkxa6Dfg1xCd fkTc125cWCBdzI1dAeApfAhXsw3AL2RuY/KqdZLbsh+cXYmmT8JG7Ta+C/giLA== =UaRC -----END PGP SIGNATURE----- --X3gaHHMYHkYqP6yf--