Kill-hup PID

Source: Internet
Author: User

Kill-hup PID

http://blog.csdn.net/zhuying_linux/article/details/7031573

Kill-hup PID
The PID is the process identity. Use this command if you want to change your 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.

By convention, when you send a pending signal (signal 1 or HUP), most server processes (all common processes) perform a reset operation and reload their configuration files. Listing 2 shows a way to send a pending signal to all running Web server processes.


Listing 2. Tell the WEB server to reload its configuration file and reset the file

[Email protected] [507PSgrepgrep grep,awk'{print $;} ' Xargs 1 sudo Kill -hup  


The above command contains a lot of operations, so let's take a closer look at each part of the pipeline. The PS and grep commands are used to search for httpd in all processes (and to ignore the grep process used to search the httpd process). 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 sudo kill-hup to send a pending signal to the appropriate process.

Both Linux and Unix are available:
Change the/etc/ssh/sshd_config, change the port inside to new ports, such as 10022, 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.

vi /etc/ssh/sshd_configkill -hup 'cat /var/run/sshd.pid '


Then you exit under the existing account and log in with the new port.

Ps:

HUP (1) is to let the process hang, sleep;

Kill (9) disowned the dead

Term (15) normal exit process

Because processes may block certain signals, they are also useful.

Kill-hup PID

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.