systemctl restart xxxとsystemctl restart xxx.service

systemctl restart xxxとsystemctl restart xxx.service

CentOSでは、次のものを使用できます。

systemctl restart xxx

サービスを再起動するには、次のものを使用できます。

systemctl restart xxx.service 

サービスも始めてみてください。

ところでここで違う点はありますか?

ベストアンサー1

man systemctl:

パラメータ構文上記のデバイスコマンドは、単一のデバイス名(NAMEで指定)または複数のデバイス仕様(PATTERN ...で指定)を使用します。最初の場合、ユニット名はサフィックスの有無にかかわらず指定する必要があります。サフィックスが指定されていない場合(デバイス名が「省略」)、systemctlはデフォルトで「.service」である適切なサフィックスを追加するか、コマンドが特定のデバイスに対してのみ実行される場合はタイプごとのサフィックスを追加します。タイプ。例えば、

       # systemctl start sshd

そして

       # systemctl start sshd.service

なぜなら等しい

       # systemctl isolate default

そして

       # systemctl isolate default.target

おすすめ記事