added --chdir2

This commit is contained in:
roberto@longshot
2010-08-11 17:35:14 +02:00
parent daa41d4a51
commit 41dfcaa705
2 changed files with 16 additions and 0 deletions
+13
View File
@@ -380,6 +380,7 @@ int main(int argc, char *argv[], char *envp[]) {
{"logto", required_argument, 0, LONG_ARGS_LOGTO},
{"logdate", no_argument, &uwsgi.logdate, 1},
{"chdir", required_argument, 0, LONG_ARGS_CHDIR},
{"chdir2", required_argument, 0, LONG_ARGS_CHDIR2},
{"grunt", no_argument, &uwsgi.grunt, 1},
{"no-site", no_argument, &Py_NoSiteFlag, 1},
{"vhost", no_argument, &uwsgi.vhost, 1},
@@ -1459,6 +1460,15 @@ int main(int argc, char *argv[], char *envp[]) {
signal(SIGPIPE, (void *) &warn_pipe);
// initialization done
if (uwsgi.chdir2) {
if (chdir(uwsgi.chdir2)) {
uwsgi_error("chdir()");
exit(1);
}
}
#ifdef __linux__
if (uwsgi.master_process && uwsgi.no_orphans) {
if (prctl(PR_SET_PDEATHSIG, SIGINT)) {
@@ -2598,6 +2608,9 @@ void manage_opt(int i, char *optarg) {
exit(1);
}
break;
case LONG_ARGS_CHDIR2:
uwsgi.chdir2 = optarg;
break;
#ifdef UWSGI_HTTP
case LONG_ARGS_HTTP:
uwsgi.http = optarg;
+3
View File
@@ -164,6 +164,7 @@ PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(char *, Py_ssize_t);
#define LONG_ARGS_MODE 17031
#define LONG_ARGS_CHDIR 17032
#define LONG_ARGS_ENV 17033
#define LONG_ARGS_CHDIR2 17034
@@ -643,6 +644,8 @@ struct uwsgi_server {
#endif
#endif
char *chdir2;
};
struct uwsgi_cluster_node {