CentOS下Fail2ban自动退出服务和字体渲染问题!

问答中心分类: OneinStackCentOS下Fail2ban自动退出服务和字体渲染问题!
IBMx345 asked 5年 ago

最近将几个站点都换成oneinstack,感觉oneinstack是目前做的最好的安装包了,省却了管理服务器的大量时间。目前一切使用正常,但是安装fail2ban并默认设置运行ssh防护时,经常过一段时间fail2ban就会自动停止服务,再次启动fail2ban就报错。不知道是因为ban ip数据多了还是其它原因导致的。
还有已给建议就是,我使用了很多的linux服务器版本,发现centos对中文字体的渲染做的很差,希望oneinstack能不能加入一个优化字体渲染的包在addons.sh里面,这对中文网站比较实用。

6 Answers
oneinstack answered 5年 ago
启动fail2ban具体报什么错误?
中文字体的渲染,用桌面?

IBMx345 answered 5年 ago
[root@promote oneinstack]# systemctl status fail2ban● fail2ban.service - LSB: Start/Stop fail2ban Loaded: loaded (/etc/rc.d/init.d/fail2ban; bad; vendor preset: disabled) Active: failed (Result: exit-code) since Wed 2017-05-03 23:30:02 CST; 10h ago Docs: man:systemd-sysv-generator(8) Process: 2762 ExecStart=/etc/rc.d/init.d/fail2ban start (code=exited, status=255) May 03 23:30:02 promote.cache-dns.local systemd[1]: Starting LSB: Start/Stop fail2ban...May 03 23:30:02 promote.cache-dns.local fail2ban[2762]: Starting fail2ban: ERROR There is no directory /var/run...ock.May 03 23:30:02 promote.cache-dns.local fail2ban[2762]: [FAILED]May 03 23:30:02 promote.cache-dns.local systemd[1]: fail2ban.service: control process exited, code=exited status=255May 03 23:30:02 promote.cache-dns.local systemd[1]: Failed to start LSB: Start/Stop fail2ban.May 03 23:30:02 promote.cache-dns.local systemd[1]: Unit fail2ban.service entered failed state.May 03 23:30:02 promote.cache-dns.local systemd[1]: fail2ban.service failed.Hint: Some lines were ellipsized, use -l to show in full.

IBMx345 answered 5年 ago
[root@promote oneinstack]# systemctl status fail2ban
● fail2ban.service - LSB: Start/Stop fail2ban
Loaded: loaded (/etc/rc.d/init.d/fail2ban; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2017-05-03 23:30:02 CST; 10h ago
Docs: man:systemd-sysv-generator(8)
Process: 2762 ExecStart=/etc/rc.d/init.d/fail2ban start (code=exited, status=255)
May 03 23:30:02 promote.cache-dns.local systemd[1]: Starting LSB: Start/Stop fail2ban...
May 03 23:30:02 promote.cache-dns.local fail2ban[2762]: Starting fail2ban: ERROR There is no directory /var/run...ock.
May 03 23:30:02 promote.cache-dns.local fail2ban[2762]: [FAILED]
May 03 23:30:02 promote.cache-dns.local systemd[1]: fail2ban.service: control process exited, code=exited status=255
May 03 23:30:02 promote.cache-dns.local systemd[1]: Failed to start LSB: Start/Stop fail2ban.
May 03 23:30:02 promote.cache-dns.local systemd[1]: Unit fail2ban.service entered failed state.
May 03 23:30:02 promote.cache-dns.local systemd[1]: fail2ban.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

IBMx345 answered 5年 ago
关于字体渲染的问题:
主要是我的网站是在本地(Windows+IIS+PHP)调试的,但是上传到CentOS后,发觉网站的字体显示和Windows下有明显区别,我不知道这和CentOS的字体渲染是不是有关系,因为我觉得相同的代码为何在Windows和CentOS运行下会出现不同的显示效果。而且明显CentOS的现实效果比Windows差一些。
所以我的意思如果这个CentOS的字体渲染有关系那么肯定要修复这个问题,但是服务器肯定是需要运行桌面的。而且我虚拟机测试过,ubuntu server下同样的代码显示效果和Windows几乎相同的。我也查过资料,有人说Linux需要安装infinality这样的字体渲染包,我不知道infinality这样的字体渲染是否只是对Linux运行桌面的时候有用还是对服务器的现实都有用。

IBMx345 answered 5年 ago
写错了,服务器肯定是不需要运行桌面

oneinstack answered 5年 ago

重启服务器导致内存中文件夹/var/run/fail2ban丢失,执行如下命令再启动试试:

sed -i 's@Starting fail2ban.*@&\n    [ ! -e "/var/run/fail2ban" ] \&\& mkdir /var/run/fail2ban@' /etc/init.d/fail2ban
systemctl daemon-reload
service fail2ban start