Pointing process to bundled static files

Assume I have a web server and static web pages defined as a legacy app in an adef file like below:

bundles:
{
    file:
    {
        [x] $CURDIR/../../webserv /bin/webserv
    }
    dir:
    {
         $CURDIR/../../website /etc/www/static
    }
}

The web server takes one argument for the directory of the static files to run, so if i were to run it manually after install it would like like:

/legato/systems/current/appsWriteable/mywebserv/bin/webserv -static /legato/systems/current/appsWriteable/mywebserv/etc/www/static 

I want the process to run at start so i am trying to use processess:run:{}, how do I pass the directory location as an argument?

does this help?

On the other hand, how about run it by system() API in unsandboxed application?

does this help?
Yes, specifically the below snippet. I’m hoping the same relative path’s work for unsandboxed apps. I’ll report back.

bundles:
{
    dir:
    {
        [rw] pages /pages
        cfg /cfg
    }
...
}
...
start: auto
processes:
{
...
    run:
    {
        ( /app/bin/lighttpd -m /modlibs/ -D -f /cfg/lighttpd.conf )
    }
}

On the other hand, how about run it by system() API in unsandboxed application?

I don’t see a system section in the adef documentation, can you point to it? If you mean system like POSIX system call, then I’d rather not have a useless parent process.

i mean a system() call like this:

The Legato is still killing my processes when run via autostart:true in the .adef, app start or app runproc but it runs fine from the command line via the /legato/systems/current/appsWriteable/ path. Specifically I get the following legato error:

Oct  7 14:34:01 wp-under-test user.emerg Legato: *EMR* | _UNKNOWN_[15619]/framework T=unknown | eventLoop.c fa_event_CreatePerThreadInfo() 153 | epoll_create1(0) failed with errno 24.

Specifically app is killing my program when i call le_thread_InitLegatoThreadData from the none-main thread (which documentation tells me to do).

What do i need to do to allow autostart and/or app to not kill my program for calling le_thread_InitLegatoThreadData ?

The final issue was two fold:

  1. the epoll_create1 issue triggered by le_thread_InitLegatoThreadData was due to a ulimit parameter in teh adef file template i was using.
  2. the original issue, pointing to a bundled static files, I needed to point to the files via the /legato/systems/current/appsWriteable/ path. I imagine this is because the app is not sandboxed.