crontab -l \n+ echo 'Permission denied crontab'
问题现象
SLB部署失败,日志详细信息提示如下:
"the_perfix=/opt/huawei/openresty\n+ crontab -l \n+ echo 'Permission denied crontab' \n+ exit 1"
解决方法
- 定时任务的权限问题。
su 业务用户 crontab -e
如果提示:“You (业务用户) are not allowed to use this program (crontab)”,说明该业务用户没有定时任务权限,进行如下命令添加业务用户后保存,一个用户一行:
vi /etc/cron.allow
图1 查看权限
- 定时任务的具体配置。
su 业务用户 crontab -e
如果内容为空,则复制以下内容,彻底解决这个问题。
59 23 * * * /opt/huawei/openresty/bin/logratate.sh >>/dev/null 2>&1 */1 * * * * source ~/.profile && bash -lc "/opt/huawei/easyconf/bin/confagent_monitor check" > /dev/null 2>&1 * * * * * /opt/huawei/openresty/watch-dog/bin/watchdog.sh mon>>/dev/null 2>&1
- 每行开头的* * * * *对应的是分 时 日 月 周,“59 23 * * *” 表示每天23点59分,“*/1 * * * * ”表示每分钟一次。
- logratate.sh 为日志切割脚本。
SLB部署失败相关问题 所有常见问题
- FATAL Can't get local ip
- /etc/rc.d/init.d/functions: No such file or directory
- nginx is stopped
- will_upgrade\old_version:1.4.7
- Need to modify /etc/hosts,but no permission.
- system param fs.nr_open should not less than fs.file-max”or“system param net.ipv4.ip_local_port_range should >=30000
- some permission denied files in /opt/huawei/openresty/nginx/conf/
- Permission denied: '/opt/huawei/release/lf_test/SLB/
- install_slb_failed for /opt/huawei/openresty exists not for slb
- not all conf included in vhosts or slb_conf
- watchdog still running
- job 28e7241e42904334b failed
- [Service proxy.apply_sudo._wrapped_f]: fail to operator sudo,message: send request fail, status code: 400, error: None, message: illegal param\",\"status\":-2}
- some html not in /opt/huawei/openresty/nginx/html
- cannot access /opt/huawei/openresty/nginx/conf/ssl/sample/resty-auto-ssl-fallback.pem.Permission denined
- fail to operator sudo, message: send request fail, status code: 400, task: control sudo permission, status: failed
- some certificate not in /opt/huawei/openresty/nginx/conf/ssl
- crontab -l \n+ echo 'Permission denied crontab'
more