Skip to Content
Linux クックブック、第 2 版
book

Linux クックブック、第 2 版

by Carla Schroder
May 2025
Intermediate to advanced
544 pages
7h 23m
Japanese
O'Reilly Media, Inc.
Content preview from Linux クックブック、第 2 版

第4章 systemdでサービスを管理する systemdでサービスを管理する

この作品はAIを使って翻訳されている。ご意見、ご感想をお待ちしている:translation-feedback@oreilly.com

Linuxコンピューターを起動するたびに、初期化システムが数十から数百のプロセスを起動する(システムのセットアップ方法による)。 この様子はスタートアップ画面で見ることができる(図4-1;グラフィカルなスタートアップ画面を隠すにはEscapeキーを、スタートアップ・メッセージを見るには )。

Linux startup messages
図4-1. Linuxの起動メッセージ

その昔、私たち は、起動時にプロセスを立ち上げるために、Unix System V初期化システム(SysV init)、BSD init、Linux Standard Base(LSB)initを持っていた。その時代は消えつつあり、今ではsystemdがLinuxのピカピカの新しいinitシステムだ。もちろん、レガシーなinitシステムをまだ使っているディストリビューションも数多くあるが、systemdはすべての主要なLinuxディストリビューションに採用されている。

この章では、あなたの Linux ディストリビューションが systemd を使っているかどうかを学ぶ。プロセス、スレッド、サービス、デーモンとは何か、systemd を使ってサービスを管理する方法を学ぶ。systemd のシステム・サービス・マネージャであるsystemctlコマンドに習熟する。

systemdは 、最新の複雑なサーバやデスクトップシステムに適した機能を提供するように設計されており、レガシーなinitシステムよりもかなり多くのことができる。 起動からシャットダウンまでの完全なサービス管理を提供し、起動時にプロセスを開始し、起動後にオンデマンドでプロセスを開始し、不要になったらサービスをシャットダウンする。システムログ、ファイルシステムの自動マウント、サービスの依存関係の自動解決、名前付けサービス、デバイス管理、ネットワーク接続管理、ログイン管理、その他多くのタスクなどの関数を管理する。

systemdは、すべてのLinuxシステムで同じように動作する、統合されたソフトウェアスイートとしてそのすべてをまとめている。あなたが使っている Linux は、本章の例とは多少異なるかもしれないことに注意してほしい。

systemd は、プロセスを同時並行的に起動し、必要なサービスだけを起動し、他のサービスは必要に応じて起動後に起動するようにすることで、起動時間を短縮し、システムリソースをより効率的に分配しようとする。 他のサービスに依存しているサービスは、そのサービスが利用可能になるまで起動を待つ必要がなくなる。必要なのは利用可能になるのを待っている Unix ソケットだけだからだ。レシピ4.9は、システムの起動を遅くしているプロセスを発見する方法を示している。

systemdのバイナリはC言語で書かれており、パフォーマンスが多少向上している。レガシーinitsはシェルスクリプトの塊であり、どんなコンパイル言語もシェルスクリプトより高速に演算する。

systemd はSysV initと後方互換性がある。ほとんどのLinuxディストリビューションは、 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Pythonデータサイエンスハンドブック 第2版 ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習

Pythonデータサイエンスハンドブック 第2版 ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習

Jake VanderPlas, 菊池 彰
Bash クックブック第2版

Bash クックブック第2版

Carl Albing, JP Vossen
行動を変えるデザイン ―心理学と行動経済学をプロダクトデザインに活用する

行動を変えるデザイン ―心理学と行動経済学をプロダクトデザインに活用する

Stephen Wendel, 武山 政直, 相島 雅樹, 反中 望, 松村 草也

Publisher Resources

ISBN: 9798341650091