[omniORB] Trouble when daemonising

Duncan Grisby duncan at grisby.org
Fri Aug 29 12:37:22 BST 2008


On Friday 29 August, Thorsten Glaser wrote:

> I’ve got some trouble with omniORBpy when dæmonising. I’ve written a
> Python module which basically does the same as the BSD libc daemon(3)
> call (fork, setsid, close stdio, chdir to /) and also switches our
> logging module from stdio to syslog. So far, this has worked quite ok.
> 
> Now I want to dæmonise just before calling the run method of the ORB,
> but I need to initialise the ORB much earlier, since, for example, it
> needs to parse command line arguments before I do. Dæmonising cannot
> (easily) be done before ORB initialisation, since there’s a flag that
> disables it, for debugging, similar to OpenNTPD.

ORB_init() creates several threads. Forking only gives you a copy of the
thread that did the fork(), meaning the child process is broken. There's
no way you can daemonise after ORB_init, I'm afraid.

If you want to do your own command line parsing, all the -ORB arguments
apart from -ORBhelp take a single extra argument. That isn't going to
change.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --



More information about the omniORB-list mailing list