Apache 2.4系でHTTP/2サーバを構築してみるテスト。
FreeBSDをバージョンアップしてみる。[2018年4月24日版] 少し前ですが、AzureにインストールしたFreeBSDのサポート期間が終了していたのに気付いたので、バージョンアップしてみました。 FreeBSD11.0⇒FreeBSD11.1へのアップグレードです。 事の発端気が向いたので、パッケージシステムのアップグレードを実行してみました。 すると、いつもと違うメッセージが・・・ # pkg upgrade The package management tool is not yet installed on your system. Do you want to fetch and install it now? [y/N]: y Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:11:amd64/quarterly, please wait... Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done Installing pkg-1.10.5... Newer FreeBSD version for package pkg: To ignore this error set IGNORE_OSVERSION=yes - package: 1101001 - running kernel: 1100122 Allow missmatch now?[Y/n]: n Failed to install the following 1 package(s): /tmp//pkg.txz.tnvvgu つまり、pkgを使ってパッケージのアップグレードをするには、カーネルが古すぎると言われてしまいました。 こうなったら、カーネルのバージョンアップ、つまりOSのバージョンアップが必要です。
セキュリティパッチの適用まず、準備としてセキュリティパッチを適用しておきます。 今回は、 FreeBSD 11.0-RELEASE-p4 を ⇒FreeBSD 11.0-RELEASE-p16 としました。この例では再起動は必要ありませんでした。 コマンドは、管理者権限になってから、freebsd-update fetchと打ちます。 # freebsd-update fetch src component not installed, skipped Looking up update.FreeBSD.org mirrors... 3 mirrors found. Fetching public key from update6.freebsd.org... done. Fetching metadata signature for 11.0-RELEASE from update6.freebsd.org... done. Fetching metadata index... done. Fetching 2 metadata files... done. Inspecting system... done. Preparing to download files... done. Fetching 228 files... done. The following files will be removed as part of updating to 11.0-RELEASE-p16: /usr/share/zoneinfo/America/Santa_Isabel /usr/share/zoneinfo/Asia/Rangoon /usr/share/zoneinfo/Pacific/Johnston The following files will be updated as part of updating to 11.0-RELEASE-p16: /bin/freebsd-version /boot/boot1.efi /boot/boot1.efifat /boot/kernel/cam.ko /boot/kernel/hv_storvsc.ko /boot/kernel/ipl.ko /boot/kernel/kernel /boot/loader (・・・省略・・・) /usr/share/man/mandoc.db /usr/share/openssl/man/mandoc.db WARNING: FreeBSD 11.0-RELEASE-p16 HAS PASSED ITS END-OF-LIFE DATE. Any security issues discovered after Thu Nov 30 23:59:59 UTC 2017 will not have been corrected.# 赤背景のように、「すでにサポート期間が終わったバージョンですよー」と、警告メッセージが出てます。 警告は出てますが、バージョンアップは次の作業なので、ここはそのままセキュリティパッチを適用するため、freebsd-update installと打ちます。 # freebsd-update install src component not installed, skipped Installing updates... done. # これで、セキュリティパッチが適用されました。
FreeBSDのOSバージョンアップセキュリティパッチの適用に成功したら、今度はFreeBSDのOSバージョンアップをおこないます。 今回は、FreeBSD 11.1にアップグレードします。 コマンドは、先ほどのセキュリティパッチと同じくfreebsd-updateコマンドを使いますが、-rオプションを使います。 使い方は以下の通りです。 途中、何回質問があり、Yes/Noを尋ねられます。 また、途中ネットワークから、相当の容量のファイルダウンロードを行うため、時間のかかります。 今回の例では、y(Yes)を二回押すと、アップグレードが走ります。 最初の質問(Does this look reasonable (y/n)?)は、 下記青文字のコンポ-ネット(kernel/genericとか)がインストールされますが、良いですか? という質問です。 # freebsd-update -r 11.1-RELEASE upgrade src component not installed, skipped Looking up update.FreeBSD.org mirrors... 3 mirrors found. Fetching metadata signature for 11.0-RELEASE from update6.freebsd.org... done. Fetching metadata index... done. Fetching 1 metadata files... done. Inspecting system... done. The following components of FreeBSD seem to be installed: kernel/generic kernel/generic-dbg world/base world/base-dbg world/doc world/lib32 world/lib32-dbg The following components of FreeBSD do not seem to be installed: Does this look reasonable (y/n)? y Fetching metadata signature for 11.1-RELEASE from update6.freebsd.org... done. Fetching metadata index... done. Fetching 1 metadata patches. done. Applying metadata patches... done. Fetching 1 metadata files... done. Inspecting system... done. Fetching files from 11.0-RELEASE for merging... done. Preparing to download files... done. Fetching 1441 patches.....10....20....30....40....50....60....70....80....90....100.... 110....120....130....140....150....160....170....180....190....200.... 210....220....230....240....250....260....270....280....290....300.... 310....320....330....340....350....360....370....380....390....400.... 410....420....430....440....450....460....470....480....490....500.... 510....520....530....540....550....560....570....580....590....600.... 610....620....630....640....650....660....670....680....690....700.... 710....720....730....740....750....760....770....780....790....800.... 810....820....830....840....850....860....870....880....890....900.... 910....920....930....940....950....960....970....980....990....1000.... 1010....1020....1030....1040....1050....1060....1070....1080....1090....1100.... 1110....1120....1130....1140....1150....1160....1170....1180....1190....1200.... 1210....1220....1230....1240....1250....1260....1270....1280....1290....1300.... 1310....1320....1330....1340....1350....1360....1370....1380....1390....1400.... 1410....1420....1430....1440 done.←ここで時間がかかる。 Applying patches... done. Fetching 10202 files... done.←ここで時間がかかる。 Attempting to automatically merge changes in files... done. The following changes, which occurred between FreeBSD 11.0-RELEASE and FreeBSD 11.1-RELEASE have been merged into /etc/ssh/sshd_config: --- current version +++ new version @@ -1,7 +1,7 @@ # $OpenBSD: sshd_config,v 1.98 2016/02/17 05:29:04 djm Exp $ -# $FreeBSD: releng/11.0/crypto/openssh/sshd_config 296633 2016-03-11 00:15:29Z des $ +# $FreeBSD: releng/11.1/crypto/openssh/sshd_config 311915 2017-01-11 05:56:40Z delphij $ # This is the sshd server system-wide configuration file. See # sshd_config(5) for more information. # This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin @@ -118,11 +118,12 @@ #UseDNS yes #PidFile /var/run/sshd.pid #MaxStartups 10:30:100 #PermitTunnel no #ChrootDirectory none -#VersionAddendum FreeBSD-20160310 +#UseBlacklist no +#VersionAddendum FreeBSD-20161230 # no default banner path #Banner none # override default of no subsystems Does this look reasonable (y/n)? y The following files are affected by updates, but no changes have been downloaded because the files have been modified locally: /var/yp/Makefile.dist The following files will be removed as part of updating to 11.1-RELEASE-p9: /usr/include/c++/v1/__undef___deallocate /usr/include/c++/v1/tr1/__undef___deallocate /usr/include/netinet/ip_ipsec.h /usr/include/netinet6/ip6_ipsec.h /usr/include/pcap-int.h /usr/lib/clang/3.8.0 (・・・省略・・・) /var/db/mergemaster.mtree To install the downloaded upgrades, run "/usr/sbin/freebsd-update install". # ちなみにFreeBSD 11.3-RELEASEへのアップグレードなら、11.1-RELEASEの代わりに、 # freebsd-update -r 11.3-RELEASE upgrade です。 上記の例では、バージョンアップに伴ってsshd_configの書き換えが発生するため、上記青背景の部分のように、sshd_configの差分が表示されます。 この差分が正しいか、聞いている質問が、Does this look reasonable (y/n)? yの部分です。 このときfreebsd-updateの処理で明らかにコンフリクトしていると思われる場合は、y/nの質問の前に、viが起動して、修正を促される場合もあります。 例えば、バージョンアップに伴い、/etc/crontabにシステム設定のPATH変数が追加されたが、バージョンアップ前にユーザが設定したPATH変数があった場合に、viが起動して、正しいPATH変数を設定するように促されます。 終わったら、インストールを行います。コマンドは、セキュリティパッチの適用の時と同くfreebsd-update installです。 # /usr/sbin/freebsd-update install src component not installed, skipped Installing updates... Kernel updates have been installed. Please reboot and run "/usr/sbin/freebsd-update install" again to finish installing updates. ただセキュリティパッチの適用と異なり、メッセージの内容が変わります。 緑色の文字にあるとおり、再起動(reboot)を促されます。 つまり、さきほどのコマンドでは、カーネルアップデートだけがインストールされます。 残りは、次の再起動後に、もう一回実施します。 そこで、 # shutdown -r now として、再起動します。
再起動後の作業再起動してきたら、再度管理者になって、freebsd-update installと打ちます。 # /usr/sbin/freebsd-update install src component not installed, skipped Installing updates... Completing this upgrade requires removing old shared object files. Please rebuild all installed 3rd party software (e.g., programs installed from the ports tree) and then run "/usr/sbin/freebsd-update install" again to finish installing updates. 今度も、セキュリティパッチの適用とは、異なるメッセージが出てきます。 サードパーティーのアプリをリビルドして、もう一回freebsd-update installを実行してほしいという内容です。 pkgシステムを使っている方は、以下のように、pkg upgradeコマンドを打ちます。 # pkg upgrade The package management tool is not yet installed on your system. Do you want to fetch and install it now? [y/N]: y Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:11:amd64/quarterly, please wait... Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done Installing pkg-1.10.5... Extracting pkg-1.10.5: 100% Updating FreeBSD repository catalogue... Repo "FreeBSD" upgrade schema 2013 to 2014: DROP TABLE pkg_search; Fetching meta.txz: 100% 944 B 0.9kB/s 00:01 Fetching packagesite.txz: 100% 6 MiB 6.4MB/s 00:01 Processing entries: 100% FreeBSD repository update completed. 31144 packages processed. All repositories are up to date. Updating database digests format: 100% Checking for upgrades (27 candidates): 100% Processing candidates (27 candidates): 100% (・・・省略・・・) けっこうファイルが更新されます。 最後にもう一回、freebsd-update installを実行します。 # /usr/sbin/freebsd-update install src component not installed, skipped Installing updates... done. と出れば作業完了です。 お疲れさまでした。
|