Carl Johnson on 15 Jan 2014 16:34:17 -0800

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] debugging an init script

Quick update here....

# prevent inheriting this setting to VBoxSVC
        start_daemon $VBOXWEB_USER $binary $PARAMS > /dev/null 2>&1
        # ugly: wait until the final process has forked
        sleep .1

this points to the problem. the script waits for  "vbox /usr/lib/virtualbox/vboxwebsrv --background -F /var/log/vboxweb.log"
to fork into the background, but it never does. as soon as the following command "sleep .1" completes, the entire script quits with [FAILED].

I guess i'm off to a bug report over @ virtualbox. I'm open to any workarounds/hacks/mods from anyone to band-aid this 'till it's fixed.

On Wed, Jan 15, 2014 at 4:02 PM, JP Vossen <> wrote:
On 01/15/2014 11:49 AM, Andrew Libby wrote:

Hi Carl,

You can probably do something like

/bin/bash -x /etc/init.d/servicescriptname {start|stop}

+1 for that, though all the ideas have been good.

You may also want to play with $PS4 which is the prompt for the -x debug output.

Possibly overkill example (and this looks like negative line numbers when not in a function):
        export PS4+xtrace $BASH_SOURCE::$FUNCNAME-$LINENO:= '

NOTE that the first character is duplicated to indicate nesting level, so make sure it's something that makes sense, like "+".

Lots more here:

JP Vossen, CISSP            |:::======|
My Account, My Opinions     |=========|
"Microsoft Tax" = the additional hardware & yearly fees for the add-on
software required to protect Windows from its own poorly designed and
implemented self, while the overhead incidentally flattens Moore's Law.
Philadelphia Linux Users Group         --
Announcements -
General Discussion  --

Philadelphia Linux Users Group         --
Announcements -
General Discussion  --