开发者

How do I daemonize a perl script from within a perl script?

I have a perl script which calls another perl script using backticks. I want to instead call this script and have it daemonize. How do I go about d开发者_JS百科oing this?

edit:

I dont care to communicate back with the process/daemon. I'll most likely just stick it in an sqlite3 table or something.


You refer to backticks, thus I suppose that you want to communicate with the daemon after it's started? Since daemons does not use STDOUT, you will have to think of some other way of passing information to and from it.

The Perl interprocess communication man page (perlipc) has several good examples of this, especially the section "Complete dissociation of child from parent".

The Proc::Daemon contains convenient functions for daemonizing a process.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜