在docker中启用systemd
1.sudo:pam_open_session Permission denied 与 Too many open files2.redis 使用 nologin 用户启动3.安装centos系统,硬盘检测报错:修改BIOS为 Legacy4.netstat 某连接的 Recv-Q(接收队列)达到500多万字节的内核参数排查5.YUM histoy 与 RPM -qa --last6.zabbix web 打开 lastest data 显示空白,http 返回 500
7.在docker中启用systemd
8.docker-compose 报错:ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+9.使用docker top查看容器内进程在系统中的pid10.git:清除所有历史提交记录,保留文件为新库(不建议)11.git:使用 git-repo-clean工具清仓库大文件,并重写commit记录(建议)12.使用fail2ban防止SSH暴力破解13.yum下载程序时被kill,系统日志打印out of memory!14.记录一次zabbix escalations 进程使用率 100%15.Linux 查看正在运行和不可中断状态下的进程16.pkttyagent WARNING: Cannot determine user of subject17.tomcat 8.0 升级 9.0,启动报错Protocol handler start failed18.使用iptables查看与特定ip的INPUT/OUT流量以 amazn linux 2023 测试
# cat amazonlinux-systemd
docker run -tid -p 2222:22 --hostname amazonlinux-systemd --name amazonlinux-systemd \
--entrypoint=/usr/lib/systemd/systemd \
--env container=docker \
--mount type=bind,source=/sys/fs/cgroup,target=/sys/fs/cgroup \
--mount type=bind,source=/sys/fs/fuse,target=/sys/fs/fuse \
--mount type=tmpfs,destination=/tmp \
--mount type=tmpfs,destination=/run \
--mount type=tmpfs,destination=/run/lock \
amazonlinux-systemd --log-level=info --unit=sysinit.target
测试成功。
如果不加那几个目录的mount
,但是增加--privileged=true
,测试结果是可以启动,但是关闭容器后重启会失败。
报错日志:
Failed to open libbpf, cgroup BPF features disabled: Operation not supported
增加了mount
的启动日志中相关的部分如下:
Not running with unified cgroup hierarchy, disabling cgroup BPF features.
区别在于是否systemd是否需要cgroup BPF features,操作系统一般是没有安装这个模块的。
本文作者:武平宁
本文链接:https://www.cnblogs.com/dewan/p/17632100.html
版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步