인프라

service httpd restart 구성내용

소행성왕자 2023. 8. 2. 14:23

centos 7 (레드햇7)

$ cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
[root@localhost system]# vi httpd.service
[root@localhost system]# pwd
/usr/lib/systemd/system
[root@localhost system]# pwd
/usr/lib/systemd/system
[root@localhost system]#

$ service httpd start  : 아파치 스타트

 

httpd 는 httpd.service 파일명이 /usr/lib/systemd/system/ 디렉토리에 있다.

httpd.service 구동하는 명령어는

$ service httpd start

$ vi httpd.service

[Unit]
Description=The Apache HTTP Server
After=network.target remote-fs.target nss-lookup.target
Documentation=man:httpd(8)
Documentation=man:apachectl(8)

[Service]
Type=notify
EnvironmentFile=/etc/sysconfig/httpd
ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND
ExecReload=/usr/sbin/httpd $OPTIONS -k graceful
ExecStop=/bin/kill -WINCH ${MAINPID}
# We want systemd to give httpd some time to finish gracefully, but still want
# it to kill httpd after TimeoutStopSec if something went wrong during the
# graceful stop. Normally, Systemd sends SIGTERM signal right after the
# ExecStop, which would kill httpd. We are sending useless SIGCONT here to give
# httpd time to finish.
KillSignal=SIGCONT
PrivateTmp=true

[Install]
WantedBy=multi-user.target