# doc2unix <file>
[排错] Linux 解决使用 wget 命令时报错 “Unable to establish SSL connection.”
报错代码:
GnuTLS: No or insufficient priorities were set.
Unable to establish SSL connection.
分析:
如果客户端和服务端的 TLS 版本不匹配,就会出现此类报错
解决方法:
# wget --secure-protocol=TLSv1 <URL>
Several situations of Linux automatically reboot without reboot logs in the /var/log/messages
Situation One
This Linux server is a virtual server. If we reboot it though its virtual software, there is no relevant logs in the /var/log/messages.
Situation Two
This Linux server is a member of a pacemaker cluster. If the pacemaker cluster software fences this server for protecting the whole cluster, there is no relate logs in the /var/log/messages.
Situation Three
This Linux server has critical problems in its system or hardware. Core panic of Linux and hardware problem both can reboot the system automatically without any reboot logs in the /var/log/messages.
[内容] Linux 当前网络流量的查看
内容一:查看此时的瞬间网络流量
# ip -s -h link
内容二:持续查看某张网卡的网络流量
# iftop -nN -i eth0
(补充:这里以持续查看名为 eth0 网卡的流量为例)
[步骤] Linux 关机前执行脚本
步骤一:创建要被管理的脚本
# vim /root/12456.sh
创建以下内容:
#!/bin/bash
for i in {1..5}
do
echo $i
done
(补充:这里以创建 /etc/root/for.sh 脚本为例)
步骤二:创建 systemctl 的管理文件
# vim /etc/systemd/system/12456.service
创建以下内容:
[Unit]
Description=12345
After=getty@tty1.service display-manager.service plymouth-start.service
Before=systemd-poweroff.service systemd-halt.service
DefaultDependencies=no
[Service]
ExecStart=/root/12456.sh
Type=forking
[Install]
WantedBy=poweroff.target
WantedBy=reboot.target
WantedBy=halt.target
(补充:这里以创建 /etc/systemd/system/12456.service 来管理 ExecStart=/root/12456.sh 为例)
步骤三:加载刚刚创建的 systemctl 管理文件
# systemctl daemon-reload
步骤四:给 systemctl 的管理文件添加执行权限
# chmod u+x /etc/systemd/system/12456.service
步骤五:设置关机前执行脚本
5.1 设置关闭系统前执行此脚本
# ln -s /usr/lib/systemd/system/12456.service /usr/lib/systemd/system/halt.target.wants/
5.2 设置关闭电源前执行此脚本
# ln -s /usr/lib/systemd/system/12456.service /usr/lib/systemd/system/poweroff.target.wants/
5.3 设置重启先执行此脚本
# ln -s /usr/lib/systemd/system/12456.service /usr/lib/systemd/system/reboot.target.wants/