File deletion and replacement in a Linux server production environment

Source: Internet
Author: User

in Linux operations often encountered in the case of replacing Linux server system programs or business application files, many people will worry, direct replacement will not cause the Linux System program crashes or application crashes, and need to shut down the service to dare to replace, Today, on the FREEBUF website, I accidentally read an article , " How to replace the Linux platform shared library " , and suddenly understood a few of the "strange" phenomena that had not been known before.

These phenomena include, but are not limited to:

    1. Delete part of an application's files, why it won't cause this application to crash

    2. How Nginx and other services can be smoothly restarted

    3. Why some deleted files can be retrieved by lsof based on Inode

    4. Why some applications need to be restarted to take effect after a file is replaced or changed

the answer to the question this article has been given a clear answer. The original (the following text is a direct reference),

for non-loaded so , the static substitution is done directly with the Copy command (CP new.so old.so), and the new so takes effect the next time it loads. For an already loaded original so, replacing it directly with the new so will cause the program to crash, in this case

, so the program can continue to function normally; Delete So just can't see, the system until the program releases so and then really delete the so and inode , so the program can continue to run normally, but in the direct copy replacement, the new so will inherit the original so's inode, the program can not continue to access the original so, causing the program to crash.

Therefore, according to this idea, in the future in the Linux operations work, you can follow this theory to do something, such as whether it is to modify or replace the money to keep the source files, which is why you need to back up before making changes one of the reasons.

Reference article: How to replace a Linux platform shared library

Tag: Production environment, file deletion, file replacement, how to live, operating standards

--end--

This article is from "Communication, My Favorites" blog, please make sure to keep this source http://dgd2010.blog.51cto.com/1539422/1863264

File deletion and replacement in a Linux server production environment

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.