Date: Fri, 18 Jul 2014 14:10:25 +0200 From: Lars Engels <lars.engels@0x20.net> To: Adrian Chadd <adrian@freebsd.org> Cc: Craig Rodrigues <rodrigc@freebsd.org>, freebsd-doc@freebsd.org, freebsd-current Current <freebsd-current@freebsd.org>, ports <freebsd-ports@freebsd.org>, Andreas Nilsson <andrnils@gmail.com> Subject: Re: HOWTO articles for migrating from Linux to FreeBSD, especially for pkg? Message-ID: <20140718121025.GD96250@e-new.0x20.net> In-Reply-To: <CAJ-VmonjWkm=A40-4sF_yjUm=djPyvM5KHnDsevDq63u-Yo6mA@mail.gmail.com> References: <CAG=rPVcyqq2072%2BgF_X91BocxykJB6%2BU0cMhaNexxfVFpVqUbA@mail.gmail.com> <CAJ-Vmo=p6-7KCL8C09O4dPq04pitW5wDbtsDAyz-u4Qtr7rpRA@mail.gmail.com> <CAPS9%2BSt%2BFF2_-FbrCTXF-D3Vb7DhnOEHDti%2B5WXeO=BYu=QeGA@mail.gmail.com> <CAJ-VmonjWkm=A40-4sF_yjUm=djPyvM5KHnDsevDq63u-Yo6mA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <andrnils@gmail.com> wrote: > > > > > > > > On Thu, Jul 17, 2014 at 9:28 PM, Adrian Chadd <adrian@freebsd.org> 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140718121025.GD96250>