jail.local 文件是作为 jail.conf 的覆盖还是作为 jail.conf 的替代?
当我从教程中学习Fail2Ban时,他们中的大多数人通常会说要么将 jail.conf 复制到 jail.local 并在那里进行编辑,其中一些人说要创建一个新的 jail.local 文件并提供一堆要复制的设置和粘贴。但他们没有解决的是 jail.local 如何与 jail.conf 一起工作。这些是2个场景:
覆盖:如果jail.local 充当jail.conf 文件的覆盖,那么我需要做的只是将我想要覆盖的必要配置添加到jail.conf 中给出的默认值中。在这种情况下,我不需要添加 SSH 配置等,因为它已经包含在 jail.conf 中。
替换:如果jail.conf 在jail.local 存在时无效,那么我需要在jail.local 中添加所有规则,然后编辑我想要修改的规则。
你能确认当 jail.local 存在时 jail.conf 会发生什么吗?如果 jail.local 的行为就像是在 jail.conf 文件之上的覆盖,那么对我来说,只需添加几行我想添加的规则就更容易了,这也使维护和可读性变得容易。什么是最好的方法?
我有一个 Debian 服务器,我只需要在启动时运行一个脚本。
我读到:https : //www.debian-administration.org/article/28/Making_scripts_run_at_boot_time_with_Debian
我现在得到:insserv:警告:脚本'缺少 LSB 标签和覆盖
所以看起来我现在必须添加:
### BEGIN INIT INFO
# Provides: scriptname
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
Run Code Online (Sandbox Code Playgroud)
现在看起来很疯狂:就像 30 行脚本只是为了在启动时运行程序。
有没有一种工具可以简单地做到这一点?
问候
我已将这些行添加到 /etc/apt/sources.list
deb http://packages.dotdeb.org wheezy-php56 all
deb-src http://packages.dotdeb.org wheezy-php56 all
Run Code Online (Sandbox Code Playgroud)
但仍然sudo apt-get update
还是sudo apt-get upgrade
不碰的PHP。
php --version
还是
PHP 5.4.39-0+deb7u2 (cli) (built: Mar 25 2015 08:33:29)
Run Code Online (Sandbox Code Playgroud) 升级到 Debian Wheezy(Debian Squeeze 之前运行)后,Syslog、auth.log、kern.log 和消息日志文件不再更新。
我怎么能修好呢?
我在 Debian Wheezy 上有一台旧的测试机器,我现在无法真正更新。
Debian Wheezy 存储库已于 2 月归档。所以我想提前,并更新我/etc/apt/sources.list
的
deb http://ftp.fr.debian.org/debian wheezy main
deb http://security.debian.org/ wheezy/updates main
deb http://ftp.fr.debian.org/debian wheezy-updates main
Run Code Online (Sandbox Code Playgroud)
到
deb http://archive.debian.org/debian wheezy main
deb http://security.debian.org/ wheezy/updates main
deb http://archive.debian.org/debian wheezy-updates main
Run Code Online (Sandbox Code Playgroud)
但是,在运行时apt-get update
,我收到此错误:
# apt-get update
<snip>
Err http://archive.debian.org wheezy-updates/main i386 Packages
404 Not Found [IP : 193.62.202.28 80]
Run Code Online (Sandbox Code Playgroud)
其他存储库正在更新,没有问题。
我错过了什么吗?
我尝试使用以下方法将整个 IPv6 (/64) 块添加到接口
ip route add local 2001:41d0:2:ad64::/64 dev lo
Run Code Online (Sandbox Code Playgroud)
像描述在这里我的Debian服务器上,但我似乎失去了一些东西。
例如2001:41d0:2:ad64::fe
,如果我在本地ping一切正常,但如果我从远程机器尝试,则它不起作用。然后我尝试在 eth0 上添加路由:
ip route add local 2001::41d0:2:ad64::/64 dev eth0
Run Code Online (Sandbox Code Playgroud)
现在我什至无法在本地 ping 任何示例地址!
我有点迷茫,因为我似乎错过了一些东西,但我在这里找不到答案。
简而言之:我想2001:41d0:2:ad64::/64
绑定到 eth0,以便可以从我机器上的 Internet 访问此块包含的每个 IP。
我希望那里有人能指出我正确的方法。提前致谢。
ISP 提供的指南确实要求我将每个 IPv6 显式添加到接口中。我希望它是隐含的。
使用显式 IP 地址绑定的工作配置
/etc/network/interfaces:
auto eth0
iface eth0 inet static
address my.ip.v4
netmask 255.255.255.0
network my.network.address.ip
broadcast my.broadcast.address.ip
gateway my.gateway.ip
iface eth0 inet6 static
address 2001:41d0:2:ad64::fe
netmask 64
gateway 2001:41d0:2:adff:ff:ff:ff:ff
up ip addr add 2001:41d0:2:ad64::1/64 dev …
Run Code Online (Sandbox Code Playgroud) 服务器运行良好——或者至少看起来如此——但总是出现以下错误:
apache2/usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted)
它发生在 Debian Wheezy 上的 Apache 2.2.22-9 上。
# apache2ctl configtest
/usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not allowed)
Syntax OK
# service apache2 reload
[....] 重新加载 Web 服务器配置:apache2/usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not allowed)
。好的
# service apache2 restart
[....] 重新启动 Web 服务器:apache2/usr/sbin/apache2ctl: 87: ulimit: 错误设置限制(不允许操作)
...等待 /usr/sbin/apache2ctl: 87: ulimit: 错误设置限制(操作不允许)
。好的
# service apache2 status
Apache2 正在运行(pid 32045)。
在 Debian 7 (Wheezy) 中 nginx 的初始化脚本中,我阅读了以下摘录:
status)
status_of_proc -p /var/run/$NAME.pid "$DAEMON" nginx && exit 0 || exit $?
;;
Run Code Online (Sandbox Code Playgroud)
此代码运行良好并sudo service nginx status
输出[ ok ] nginx is running
. 然而status_of_proc
没有在 bash 中定义,也没有在 dash 中定义:
$ type status_of_proc
status_of_proc: not found
Run Code Online (Sandbox Code Playgroud)
虽然如果我将相同的检查插入到 nginx 脚本中,我会得到以下结果:
status_of_proc is a shell function
Run Code Online (Sandbox Code Playgroud)
在 init 文件本身上运行 bash 提供了进一步的解释:
status_of_proc is a function
status_of_proc ()
{
local pidfile daemon name status OPTIND;
pidfile=;
OPTIND=1;
while getopts p: opt; do
case …
Run Code Online (Sandbox Code Playgroud) gitlab
通过debian 7
(version 7.8.1-omnibus-1_amd64.deb
)上的 omnibus 包安装了该包;sudo gitlab-ctl reconfigure
完成没有错误)。nginx
除了包可能使用以下/etc/gitlab/gitlab.rb
文件创建的内容外,我没有此 gitlab 的 ' 配置:
external_url 'http://git.mydomain.fr'
web_server['external_users'] = ['www-data']
nginx['enable'] = false
ci_nginx['enable'] = false
Run Code Online (Sandbox Code Playgroud)
2015/02/28 14:29:16 [alert] 4137#0: *14738 768 worker_connections are not enough while connecting to upstream, client: x.x.128.194, server: git.mydomain.fr, request: "GET / HTTP/1.0", upstream
: "http://x.x.128.194:80/", host: "git.mydomain.fr"
Run Code Online (Sandbox Code Playgroud)
在 acces.log 中,我收到了数百个关于/
.
x.x.128.194 - - [28/Feb/2015:14:29:16 +0100] "GET …
Run Code Online (Sandbox Code Playgroud) 我使用一些基于Perl脚本的Nagios的维修检查,我得到(Service check did not exit properly)
和(null)
作为结果在Nagios的,但脚本作品在命令行上很大。
我在网上看到的解决方案建议通过enable_embedded_perl=0
在 Nagios 配置中设置或明确指定解释器的路径来禁用内部 Perl 解释器。这对问题没有帮助。
还能是什么?