systemd と存在しない *.service ファイル: 汎用ですか?

systemd と存在しない *.service ファイル: 汎用ですか?

systemd単位は次のように保存されます/lib/systemd/system

rsync.service
avahi-daemon.socket
bluetooth.service
cups.service

次のコマンドを使用する場合:

systemctl enable name

nameを有効にしたいサービス単位の名前に置き換えます(例apache2:)。このコマンドは、[Install]選択したサービスユニットの一部を読み取り、ディレクトリ/lib/systemd/system/name.serviceとそのサブディレクトリのファイルへの適切なシンボリックリンクを作成します。/etc/systemd/system/

しかし、*.service/lib/systemd/system一部のパッケージにはmysqlありませんapache2。これを有効にすると、次のように機能systemctlします。

# systemctl enable apache2
Synchronizing state for apache2.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d apache2 defaults
Executing /usr/sbin/update-rc.d apache2 enable

または

# systemctl enable mysql
Synchronizing state for mysql.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d mysql defaults
Executing /usr/sbin/update-rc.d mysql enable

次のサービスに関連するファイルを検索しても結果はありません。

# find /etc/systemd/system/ -iname "*apache2*"
# find /etc/systemd/system/ -iname "*mysql*"

systemdはapache2またはmysqlを有効にする方法をどのように知っていますか?

ベストアンサー1

update-rc.dを使用してapache2.serviceの状態をsysvinitと同期します。

あなたの答えはすぐそこにあります。 systemd には、これらのデーモンのサービス単位はありません。ただし、これにはSystem 5rcスクリプトがあります/etc/init.d/。したがって、これらのスクリプトを処理してupdate-rc.dLSBヘッダーを読み取り、間接的にデーモンを有効/無効にします。

おすすめ記事