From owner-freebsd-ports@FreeBSD.ORG Fri Jul 18 12:10:31 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 E39F0178; Fri, 18 Jul 2014 12:10:31 +0000 (UTC) Received: from mail.0x20.net (mail.0x20.net [IPv6:2001:aa8:fffb:1::3]) (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 690A62C10; Fri, 18 Jul 2014 12:10:31 +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 94EBE6A6032; Fri, 18 Jul 2014 14:10:26 +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 s6ICAQWP044731; Fri, 18 Jul 2014 14:10:26 +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 s6ICAP42043569; Fri, 18 Jul 2014 14:10:25 +0200 (CEST) (envelope-from lars) Date: Fri, 18 Jul 2014 14:10:25 +0200 From: Lars Engels To: Adrian Chadd Subject: Re: HOWTO articles for migrating from Linux to FreeBSD, especially for pkg? Message-ID: <20140718121025.GD96250@e-new.0x20.net> Mail-Followup-To: Lars Engels , Adrian Chadd , Andreas Nilsson , Craig Rodrigues , freebsd-doc@freebsd.org, freebsd-current Current , ports References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="osDK9TLjxFScVI/L" Content-Disposition: inline In-Reply-To: X-Editor: VIM - Vi IMproved 7.4 X-Operation-System: FreeBSD 8.4-RELEASE-p4 User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Craig Rodrigues , freebsd-doc@freebsd.org, freebsd-current Current , ports , Andreas Nilsson 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 12:10:32 -0000 --osDK9TLjxFScVI/L Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 wrot= e: > >> > >> 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 w= hen 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. No, Sir! No need to edit anything: root@testjail: # pkg install apache24 Updating repository catalogue The following 5 packages will be installed: 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 The installation will require 47 MB more space 5 MB to be downloaded 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 groups. 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. 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. root@testjail: # sysrc apache24_enable=3Dyes apache24_enable: -> yes 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: # 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. 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. Like:=20 - To start the script "apache24" once run "service apache24 onestart". - To start the script "apache24" at boot time run "sysrc apache24_enable=3D= yes" - The script "apache24" has the following optional settings for /etc/rc.con= f: 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 apa= che --osDK9TLjxFScVI/L Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQF8BAEBCgBmBQJTyQ6xXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ4RjQwMDE3RTRERjUzMTI1N0FGRTUxNDlF NTRDQjM3RDNBMDg5RDZEAAoJEOVMs306CJ1t0EkH/0Q+FCOMJjhCxNR9bIhKsYsT nKypfbl/5FEeR+6jXadtsrhMqXSl1H2ptduWCP5x7QwaP3UgEzc00AQfBh+18B+R SXPZHffUP55n8sorqCKzp5glW+vQmfuCjX4ap5N62Ch1AfI2T6H5FKLLWDCJxDJ2 YKuqJOXuRVonvAyHsix6ducjKwEiS1bJFNeyCWEfsLY+1x5vHzq/plOve8BoAjG7 0uwT2I3LqAZeg3Vtfk3qWbvJhfZk+UjVrY6jHTUu4jVVyuZ8mPcJS0vtaSbyYFxK Iw8u9rLOXslkgzAhZE07LEyh6lsDI0yPkNu1H5euD2zvDp4NBaLWQI3ytOcnXuY= =/umA -----END PGP SIGNATURE----- --osDK9TLjxFScVI/L--