mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-08 06:31:58 +00:00
--spooler-chdir
This commit is contained in:
@@ -403,6 +403,12 @@ void spooler_manage_task(char *dir, char *task) {
|
||||
|
||||
close(spool_fd);
|
||||
|
||||
if (uwsgi.spooler_chdir) {
|
||||
if (chdir(uwsgi.spooler_chdir)) {
|
||||
uwsgi_error("chdir()");
|
||||
}
|
||||
}
|
||||
|
||||
int callable_found = 0;
|
||||
for(i=0;i<0xff;i++) {
|
||||
if (uwsgi.p[i]->spooler) {
|
||||
|
||||
@@ -117,6 +117,7 @@ static struct option long_base_options[] = {
|
||||
#ifdef UWSGI_SPOOLER
|
||||
{"spooler", required_argument, 0, 'Q'},
|
||||
{"spooler-ordered", no_argument, &uwsgi.spooler_ordered, 1},
|
||||
{"spooler-chdir", required_argument, 0, LONG_ARGS_SPOOLER_CHDIR},
|
||||
#endif
|
||||
{"mule", optional_argument, 0, LONG_ARGS_MULE},
|
||||
{"disable-logging", no_argument, 0, 'L'},
|
||||
@@ -3516,6 +3517,9 @@ static int manage_base_opt(int i, char *optarg) {
|
||||
case LONG_ARGS_SPOOLER_HARAKIRI:
|
||||
uwsgi.shared->options[UWSGI_OPTION_SPOOLER_HARAKIRI] = atoi(optarg);
|
||||
return 1;
|
||||
case LONG_ARGS_SPOOLER_CHDIR:
|
||||
uwsgi.spooler_chdir = optarg;
|
||||
return 1;
|
||||
case LONG_ARGS_MULE_HARAKIRI:
|
||||
uwsgi.shared->options[UWSGI_OPTION_MULE_HARAKIRI] = atoi(optarg);
|
||||
return 1;
|
||||
|
||||
@@ -526,6 +526,7 @@ struct uwsgi_opt {
|
||||
#define LONG_ARGS_SPOOLER_HARAKIRI 17148
|
||||
#define LONG_ARGS_MULE_HARAKIRI 17149
|
||||
#define LONG_ARGS_EMPEROR_STATS 17150
|
||||
#define LONG_ARGS_SPOOLER_CHDIR 17151
|
||||
|
||||
|
||||
#define UWSGI_OK 0
|
||||
@@ -1208,6 +1209,7 @@ struct uwsgi_server {
|
||||
|
||||
#ifdef UWSGI_SPOOLER
|
||||
char *spool_dir;
|
||||
char *spooler_chdir;
|
||||
int spooler_ordered;
|
||||
uint64_t spooler_respawned;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user