问题描述
用crontab
执行自己编写的Shell脚本报错,iptables
命令返回127(command not found) ,在后台手动执行脚本是正常的。
解决方法
添加PATH,在脚本里添加如下:
1 | export PATH=/usr/sbin/:$PATH |
使用以下命令检查当前 MicroK8s 控制平面运行状态:
1 | microk8s status |
确认 MicroK8s 控制平面运行正常后,使用以下命令获取 Kubernetes 集群的配置信息:
1 | microk8s config view |
找到以下行,其中包含 API Server 的证书:
1 | certificate-authority-data: *** |
在终端中解码证书数据并输出详细信息:
1 | openssl x509 -in <(echo "<cert-data>") -text -noout | grep "Not After" |
将
microk8s证书默认路径:/var/snap/microk8s/current/certs/
Add following line to spec file
1 | %define _build_id_links none |
peter
并设置密码huawei@123
1 | useradd peter |
chage
命令设置密码过期时间,这里设置7天后密码过期,过期后立即失效1 | chage -m 0 -M 7 -I 0 peter |
1 | /etc/init.d/vpxa stop ; /etc/init.d/hostd restart |
tar命令打包时,默认会带上文件路径,举例如下:
1 | # tree |