linux:commands:service

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
linux:commands:service [2013/02/04 14:13] ともやんlinux:commands:service [2023/04/29 08:37] (現在) ともやん
行 2: 行 2:
  
 ===== サービス起動 ===== ===== サービス起動 =====
 +Fedora
 <code> <code>
-$ sudo service httpd start+$ sudo systemctl start httpd.service 
 +</code> 
 +<code> 
 +$ sudo systemctl start {httpd,php-fpm}
 </code> </code>
  
-Fedora 15 以降+CentOS 6
 <code> <code>
-sudo systemctl start httpd.service+sudo service httpd start
 </code> </code>
  
 ===== サービス停止 ===== ===== サービス停止 =====
 +Fedora
 <code> <code>
-$ sudo service httpd stop+$ sudo systemctl stop httpd.service 
 +</code> 
 +<code> 
 +$ sudo systemctl stop {httpd,php-fpm}
 </code> </code>
  
-Fedora 15 以降+CentOS 6
 <code> <code>
-sudo systemctl stop httpd.service+sudo service httpd stop
 </code> </code>
  
 ===== サービス再起動 ===== ===== サービス再起動 =====
-stop & start を実行する。+Fedora
 <code> <code>
-$ sudo service httpd restart+$ sudo systemctl restart httpd.service 
 +</code> 
 +<code> 
 +$ sudo systemctl restart {httpd,php-fpm}
 </code> </code>
  
-Fedora 15 以降+CentOS 6
 <code> <code>
-sudo systemctl restart httpd.service+sudo service httpd restart
 </code> </code>
  
 ===== サービス設定反映 ===== ===== サービス設定反映 =====
-サービスにHUPシグナルを送って設定を反映させる。+Fedora 
 +<code> 
 +$ sudo systemctl reload httpd.service 
 +</code> 
 +サービスにHUPシグナルを送って設定を反映させる。\\ 
 +\\ 
 +CentOS 6
 <code> <code>
 $ sudo service httpd reload $ sudo service httpd reload
 </code> </code>
  
-Fedora 15 以降+===== サービス自動起動設定 ===== 
 +Fedora
 <code> <code>
-sudo systemctl reload httpd.service+sudo systemctl enable httpd.service
 </code> </code>
 +<code>
 +$ sudo systemctl enable --now httpd
 +</code>
 +
 +CentOS 6
 +<code>
 +$ sudo chkconfig httpd on
 +</code>
 +
 +===== サービス自動起動無効設定 =====
 +Fedora
 +<code>
 +$ sudo systemctl disable httpd.service
 +</code>
 +
 +CentOS 6
 +<code>
 +$ sudo chkconfig httpd off
 +</code>
 +
 +===== サービス状態表示 =====
 +Fedora
 +<code>
 +$ systemctl status acpid
 +</code>
 +<code>
 +$ systemctl status {httpd,php-fpm}
 +</code>
 +
 +===== サービス一覧表示 =====
 +Fedora
 +<code>
 +$ systemctl -t service --all
 +</code>
 +
 +CentOS 6
 +<code>
 +$ chkconfig --list
 +</code>
 +
 +===== systemd のランレベル設定方法 =====
 +[[linux:change_systemd_runlevel|systemd のランレベル設定方法]]\\
 +
 +===== systemd のサービス定義ファイルの内容表示 =====
 +<code>
 +$ cat /usr/lib/systemd/system/named-chroot.service
 +</code>
 +
 +===== 参考文献 =====
 +[[https://community.nethserver.org/t/systemctl-and-vendor-preset-disabled/18355|Systemctl and "vendor preset: disabled" - Support - NethServer Community]]\\
 +[[https://www.freedesktop.org/software/systemd/man/systemd.preset.html|systemd.preset]]\\
 +
  • linux/commands/service.1359954823.txt.gz
  • 最終更新: 2019/05/18 02:23
  • (外部編集)