I pushed plugin to github:
https://github.com/m-garanin/uwsgi_remux_plugin/blob/master/remuxlib.c#L172
or here:
///
int remux_cmd(char* cmd, char *in_filename, char *out_filename){
extern char **environ;
int status;
pid_t pid;
char* args[3];
args[0] = cmd;
args[1] = in_filename;
args[2] = out_filename;
args[3] = NULL;
status = posix_spawn(&pid, cmd, NULL, NULL, args, environ);
waitpid(pid, &status, 0);
return 0;
}
20.02.2016, 18:41, "Roberto De Ioris" <[email protected]>:
>> Hi,
>> my simple plugin just runs simple shell-script. So it consists raws:
>> ...
>> status = posix_spawn(&pid, cmd, NULL, NULL, args, environ);
>> waitpid(pid, &status, 0);
>> ....
>>
>> My script worked,I got result and happy.
>> But I'm not fully happy when saw this raws in uwsgi-log for each requests:
>> ...
>> DAMN ! worker 2 (pid: 80995) died, killed by signal 6 :( trying respawn
>> ...
>> Respawned uWSGI worker 2 (new pid: 81004)
>> ....
>>
>> So my question: what is true-way for run custom-shell command under
>> uwsgi-plugin?
>
> can you paste the whole code ? from the error it looks like a segfault
>
> --
> Roberto De Ioris
> http://unbit.com
> _______________________________________________
> uWSGI mailing list
> [email protected]
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi