Take nginx as an example: assume that the nginx service has been compiled and installed, and the startup script is stored under/etc/init. d. The script is named nginx and can be modified as the execution permission. [Root @ yum ~] # Cd/lib/systemd/system/[root @ yumsystem] # vimng.pdf. service [Unit
Take nginx as an example:
Assume that the nginx service has been compiled and installed, and the startup script is stored under/etc/init. d. The script is named nginx and can be modified to the executable permission.
[Root @ yum ~] # Cd/lib/systemd/system/
[Root @ yum system] # vim nginx. service
[Unit]
Description = nginx
Afterdomainnetwork.tar get
[Service]
Type = forking
ExecStart =/etc/init. d/nginx start
ExecReload =/etc/init. d/nginx restart
ExecStop =/etc/init. d/nginx stop
PrivateTmp = true
[Install]
Wantedbypolicmulti-user.tar get
[Root @ yumsystem] # systemctl enable nginx. service
[Root @ yum system] # systemctl start nginx. service
[Root @ yum system] # netstat-lntp | grep nginx
Tcp 0 0 0.0.0.0: 80 0.0.0.0: * LISTEN 15136/nginx: master