当前位置:网站首页>A fault record of misoperation dhclient script
A fault record of misoperation dhclient script
2022-06-24 11:15:00 【gourd】
One about misoperation dhclient-script Fault records
A dhclient-script failure record for an incorrect operation
cause
Causes
Because there is one that serves aws Domain name resolution failed for , The business cannot be released normally . Domestic analysis aws Domain name failed , Foreign Normal . Here are two solutions :
- To configure hosts
- modify /etc/resolv.conf modify hosts Can solve the problem temporarily , But if aws Changed the direction , It needs to be modified . So use the second method . But when it's done /etc/resolv.conf after , Carry out orders service network restart, Will find /etc/resolv.conf Reset , Invalidate a modification . It's because /usr/sbin/dhclient-script Caused by .
Because of a moment's negligence, he directly carried out :
mv /usr/sbin/dhclient-script /usr/sbin/dhclient-scriptbak service network restart
After the execution, he looks confused ,ec2 It's a brick , Link broken , No more links .
Due to a domain name resolution failure for AWS, the business cannot be published normally.
Domestic resolution of AWS domain failed, foreign normal.
There are two solutions:
- The configuration of hosts
- Modify the/etc/resolv. Conf
Modifying Hosts can solve the problem temporarily, but you will need to make further changes if AWS is directed elsewhere.
So use the second method.
But when modifying the/etc/resolv. Conf, execute the command service network restart, will find that the/etc/resolv. Conf reset, disable modification.
/usr/sbin/dhclient-script = /usr/sbin/dhclient-script = /usr/sbin/dhclient-script
To execute directly out of an oversight:
mv /usr/sbin/dhclient-script /usr/sbin/dhclient-scriptbak service network restart
After the implementation of a face of muddled, EC2 into a brick, the link is broken, can not be linked.
Start repairing
Begin to repair
Repair ideas : Mount the problem disk to a computer that can be connected normally ec2 On , After the repair , Hang up again . Because of this ec2 machine , There are two disks attached to it , Namely /dev/xvda(root device) and /dev/sdb.
- Make /dev/xvda snapshot.
- from snapshot establish volume.
- take volume Mount to normal ec2 On the machine /dev/sdf1.
- Carry out orders
mkdir /fix mount /dev/sdf1 /fix mv /fix/usr/sbin/dhclient-scriptbak /usr/sbin/dhclient-script umount /dev/sdf1
- stay aws Admiral volume From normal ec2 detach.
- Shut down the faulty machine , uninstall /dev/xvda.
- What will be repaired volume Mount back to fault ec2 Of root Partition . Partition path /dev/xvda
- Start the faulty machine , Complete the repair .
repair idea: mounts the defective disk to a normally connected EC2, fixes it, and then mounts it back. has two disks mounted on this EC2 machine, /dev/xvda(root device) and /dev/sdb.
- Make /dev/xvda snapshot.
- Create volume from snapshot
- Mount the volume on /dev/sdf1 on a normal EC2 machine.
- Follow orders
mkdir /fix mount /dev/sdf1 /fix mv /fix/usr/sbin/dhclient-scriptbak /usr/sbin/dhclient-script umount /dev/sdf1
- Remove the volume from normal EC2 detach on AWS.
- Shutdown the failed machine and uninstall /dev/xvda.
- Re-mount the repaired volume back into the root partition of the failed EC2. Partition path /dev/xvda
- Start the faulty machine and complete the repair.
dhclient-script Introduce
DHCP From time to time, the client's network configuration script is dhclient call . This script is dhcp The client is used to set the initial configuration of each interface before requesting the address , Test after the address is provided , And set the final configuration of the interface after obtaining the lease . This script doesn't mean it can be customized by the end user . If local customization is needed , You should be able to use the input and output hooks provided . These hooks will allow the user to create /etc/resolv.conf The default behavior of the client is overridden when a file is created . When it starts , The client script first defines a shell function ,make_resolv_conf, It was then used to create /etc/resolv.conf file . To override the default behavior , Please redefine this function in the hook script .
dhclient-script Introduction
The DHCP client network configuration script is invoked from time to time by dhclient. This script is used by the dhcp client to set each interface’s initial configuration prior to requesting an address, to test the address once it has been offered, and to set the interface’s final configuration once a lease has been acquired. This script is not meant to be customized by the end user. If local customizations are needed, they should be possible using the enter and exit hooks provided. These hooks will allow the user to override the default behavior of the client in creating a /etc/resolv.conf file. When it starts, the client script first defines a shell function, make_resolv_conf, which is later used to create the /etc/resolv.conf file. To override the default behavior, redefine this function in the enter hook script. Personal blog : https://www.bthlt.com
边栏推荐
- Network monitoring: active troubleshooting becomes simple
- TP-LINK 1208路由器教程(2)
- The nodejs service global timeout callback failed to get process Domain problem
- How to open a video number?
- Understanding of homogeneous coordinates
- What is the bin file for? How to open the file correctly
- Concise tutorial | making cartoon heat map with PPT - EFP graph?!
- What is the function of the graphics card driver? Do you want to update the graphics card driver
- 如何只导出word文档中的标题?(即将正文内容都删除,只保留标题)B站牛逼
- Window function row in SQL Server_ number()rank()dense_ rank()
猜你喜欢
【本周六活动】.NET Day in China
历史上的今天:图灵诞生日;互联网奠基人出生;Reddit 上线
把騰訊搬到雲上,治愈了他們的技術焦慮
Maui's way of learning -- Opening
TP-LINK 1208路由器教程(2)
math_ Summation and derivation of proportional series & derivation of sum and difference of equal powers / difference between two nth power numbers/
Fais ce que tu veux.
软件测试 对前一日函数的基本路径测试
Plant growth H5 animation JS special effect
Visual presentation of pictures effectively enhances the attraction of large screen
随机推荐
2D 照片变身 3D 模型,来看英伟达的 AI 新“魔法”!
Tencent geek challenge small - endless!
@Requestbody annotation
Why are some old SEO methods still effective?
"Adobe international certification" Adobe Photoshop adjusts cropping, rotation and canvas size
Déplacer Tencent sur le cloud a guéri leur anxiété technologique
Today's sleep quality record 76 points
09. Tencent cloud IOT device side learning -- RRPC and behavior
Why should we make the best use of the external chain in SEO?
Plant growth H5 animation JS special effect
RPM installation percona5.7.34
What characteristics should a good design website have?
TP-LINK 1208路由器教程(2)
What are the means of network promotion?
Maui's way of learning -- Opening
Analysis and understanding of Jieba stutter word segmentation principle HMM application in Chinese word segmentation and partial code reading
工具及方法 - 在Source Insight中使用代码格式化工具
Base64 decoding method three ways for non professionals
08. Tencent cloud IOT device side learning - device shadow and attributes
Jetpack Compose 教程之 从一开始就投资于良好的导航框架将帮助您在之后节省大量的迁移工作