You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Petteri Räty (JIRA)" <ji...@apache.org> on 2007/01/24 22:56:49 UTC

[jira] Commented: (DAEMON-92) jsvc fails to execve() self on Linux

    [ https://issues.apache.org/jira/browse/DAEMON-92?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12467164 ] 

Petteri Räty commented on DAEMON-92:
------------------------------------

execve works just fine with relative paths here:

betelgeuse@pena ~/c-koodaus $ ./exec
Hello World!
betelgeuse@pena ~/c-koodaus $ cat exec.c
#include <unistd.h>
int main(int nArgs, char **ppArgs)
{
        char *const argv[] = {NULL};
        char *const envp[] = {NULL};
        execve("./hello", argv, envp);
}


> jsvc fails to execve() self on Linux
> ------------------------------------
>
>                 Key: DAEMON-92
>                 URL: https://issues.apache.org/jira/browse/DAEMON-92
>             Project: Commons Daemon
>          Issue Type: Bug
>    Affects Versions: 1.0.1 Final
>            Reporter: Simone Piunno
>             Fix For: 1.0.1 Final
>
>         Attachments: 1.0.1-execve-self.patch
>
>
> On Linux jsvc execve() itself.
> execve() requires an absolute path as the first argument therefore use of argv[0] only works when jsvc was invoked with a full path.
> Executing jsvc as relative path fails with "jsvc error: Cannot execute JSVC executor process".
> On Linux the full path to self is very easy to find: "/proc/self/exe"
> I'm attaching a patch fixing this problem and falling back to argv[0] in case /proc is not mounted.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org