Use of the Kill-hup command

Source: Internet
Author: User

kill-hup pid
Where PID is the process identity. Use this command if you want to change the configuration without stopping and restarting the service. After making the necessary changes to the configuration file, issue the command to dynamically update the service configuration.

Example:

Restart Nginx:

# kill-hup ' Cat/app/nginx/nginx.pid '

Restart the HTTPD service:

# Ps-a | grep httpd | Grep-v grep | awk ' {print '} ' | Xargs-l 1 Kill-hup
PS and grep commands are used to search for httpd in all processes (and to ignore the grep process used to search for httpd processes). Next, awk displays only the process ID in the output and passes it to Xargs. The Xargs command then accepts each process ID (because the-l 1 is used to fetch one row at a time) and uses Kill-hup to send a pending signal to the appropriate process.


In the example: Restart the sshd service

Change the/etc/ssh/sshd_config, the port inside to the new ports, such as 28, and then Kill-hup ' Cat/var/run/sshd.pid ' on the line.
The existing connection itself will not be broken, because Kill-hup ' cat/var/run/sshd.pid ' is just the one HUP listening, the established connection (different PID) will not break. Then you exit under the existing account and log in with the new port.





This article is from the "willing to share with you" blog, please be sure to keep this source http://9265463.blog.51cto.com/9255463/1774210

Use of the Kill-hup command

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.