Nginx attributed to the management systemd

[root @ centos7 ~] # vim / usr / lib / systemd / System / nginx.service 
[Unit] 
the Description = at The Nginx HTTP Server daemon  # must be added to the patron saint or will be error 
# description of 
the After = network.target Remote-FS. target nss- lookup.target
 before the specified start # nginx need for other additional services, such as network.target etc. 
[service] 
type = forking
 #type for the type of service, start the service only as a master process simple, we need to start several sub-processes the service is forking 
ExecStart = / usr / local / nginx / sbin / nginx
 # set a specific command execution systemctl start nginx needs to be started. 
ExecReload = / usr / local / nginx / sbin / nginx - S reload
 # set to perform systemctl reload nginx specific command to be executed. 
ExecStop = / bin / the kill- S MAINPID the QUIT} $ {
 # set specific command executed systemctl stop nginx need to be performed. 
[The Install] 
WantedBy = Multi- user.target 
[centos7 the root @ ~] #systemctl daemon- reload # load multiple times it 
# then nginx will be the same as with the public service it! 
[centos7 the root @ ~ ] #systemctl Start Nginx 
[centos7 the root @ ~ ] #systemctl Start renginx 
[centos7 the root @ ~ ] #systemctl reload Nginx 
[centos7 the root @ ~] #systemctl STOP Nginx

 

Guess you like

Origin www.cnblogs.com/tomcache/p/11401973.html