systemctl コマンドで指定する .service は省略化
systemctl コマンドでサービスを起動や停止するときに、.service の部分は省略できます。
以下の二つのコマンドは同じ意味です。
systemctl restart nginx.service
systemctl restart nginx
.service が省略できることは、公式マニュアルにも記載されています。
ただし、ファイル拡張子は省略することができます。省略すると、
https://access.redhat.com/documentation/ja-jp/red_hat_enterprise_linux/7/html/system_administrators_guide/sect-managing_services_with_systemd-servicessystemctl
は、引数がサービスユニットであることを想定します。
CentOSはRedhat Linuxをベースに作られているので、公式のドキュメントはRedhat Linuxのものを見ます。
最近のコメント