在Debian上更新start-stop-daemon

我有Debian Lenny框,我打算广泛地使用start-stop-daemon 。 麻烦的是,标准的Debian start-stop-daemon不支持输出redirect:– --stderr--stderr键,我想用它来logging守护进程的活动。

我应该从源头更新start-stop-daemon吗? 我尝试apt-get更新过程,版本仍然缺乏function。 它会破坏Debian中的某些东西吗? 或者我应该编译新的start-stop-daemon到一个新的目录,并将其用于我的守护进程,使标准的Debian软件包到位?

我不想将.sh包装器脚本写入每个守护进程,因为它们中会有很多。

通常情况下,我会build议你从不稳定的版本中恢复你想要的版本。 只要抓住那个软件包的不稳定树中的所有资源……但是,它在dpkg软件包中,这可能比你想咬的更多。

所以是的,你自己编译并放在/ usr / local / bin /中,你应该很好。

start-stop-deamon 的手册页确实提供了一个关于如何redirectstdout / stderr的线索,尽pipe以一种神秘的方式:

在命令行上给出的任何参数都将不加修改地传递给正在启动的程序。

因此,下面的语法将允许您使用stdout / stderrredirect的start-stop-daemon

  OPTIONS=" 1>/dev/null 2>${logfile}" start-stop-daemon --start --startas /usr/bin/foo -- $OPTIONS 

你觉得为start-stop-deamon写一个.sh包装器吗?

你可以重新命名原始的start-stop-deamon可执行文件,并用“start-stop-deamon”的名字创build你的.sh包装器。