VirtualBox

Changeset 19296 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
May 1, 2009 4:56:44 PM (16 years ago)
Author:
vboxsync
Message:

Main/FreeBSD: Use the same approach as on Darwin for daemonizing VBoxSVC. The fork approach doesn not work. The second child fails for some unknown reason when initializing XPCOM and the debugger or strace do not contain any information

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/xpcom/server.cpp

    r19222 r19296  
    772772    {
    773773        { "automate",       no_argument,        NULL, 'a' },
    774 #ifdef RT_OS_DARWIN
     774# if defined(RT_OS_DARWIN) || defined(RT_OS_FREEBSD)
    775775        { "auto-shutdown",  no_argument,        NULL, 'A' },
    776776#endif
    777777        { "daemonize",      no_argument,        NULL, 'd' },
    778778        { "pidfile",        required_argument,  NULL, 'p' },
    779 #ifdef RT_OS_DARWIN
     779# if defined(RT_OS_DARWIN) || defined(RT_OS_FREEBSD)
    780780        { "pipe",           required_argument,  NULL, 'P' },
    781781#endif
     
    806806            }
    807807
    808 #ifdef RT_OS_DARWIN
     808# if defined(RT_OS_DARWIN) || defined(RT_OS_FREEBSD)
    809809            /* Used together with '-P', see below. Internal use only. */
    810810            case 'A':
     
    827827            }
    828828
    829 #ifdef RT_OS_DARWIN
     829# if defined(RT_OS_DARWIN) || defined(RT_OS_FREEBSD)
    830830            /* we need to exec on darwin, this is just an internal
    831831             * hack for passing the pipe fd along to the final child. */
     
    933933        close(daemon_pipe_fds[0]);
    934934
    935 # ifdef RT_OS_DARWIN
     935# if defined(RT_OS_DARWIN) || defined(RT_OS_FREEBSD)
    936936        /*
    937937         * On leopard we're no longer allowed to use some of the core API's
     
    939939         * So, we'll have to execv VBoxSVC once again and hand it the pipe
    940940         * and all other relevant options.
     941         *
     942         * On FreeBSD the fork approach doesn't work. The child fails
     943         * during initialization of XPCOM for some unknown reason and
     944         * exits making it impossible to autostart VBoxSVC when starting
     945         * a frontend (debugger and strace don't contain any useful info).
    941946         */
    942947        const char *apszArgs[7];
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette