mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-08 06:31:58 +00:00
improved screen support
This commit is contained in:
@@ -1369,6 +1369,15 @@ void uwsgi_python_hijack(void) {
|
||||
|
||||
#ifndef UWSGI_PYPY
|
||||
if (up.pyshell && uwsgi.mywid == 1) {
|
||||
// re-map stdin to stdout and stderr if we are logging to a file
|
||||
if (uwsgi.logfile) {
|
||||
if (dup2(0, 1) < 0) {
|
||||
uwsgi_error("dup2()");
|
||||
}
|
||||
if (dup2(0, 2) < 0) {
|
||||
uwsgi_error("dup2()");
|
||||
}
|
||||
}
|
||||
UWSGI_GET_GIL;
|
||||
PyImport_ImportModule("readline");
|
||||
PyRun_InteractiveLoop(stdin, "uwsgi");
|
||||
|
||||
@@ -2359,6 +2359,20 @@ PyObject *py_uwsgi_reload(PyObject * self, PyObject * args) {
|
||||
return Py_True;
|
||||
}
|
||||
|
||||
/* uWSGI stop */
|
||||
PyObject *py_uwsgi_stop(PyObject * self, PyObject * args) {
|
||||
|
||||
if (kill(uwsgi.workers[0].pid, SIGQUIT)) {
|
||||
uwsgi_error("kill()");
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
|
||||
|
||||
/* blocking hint */
|
||||
PyObject *py_uwsgi_set_blocking(PyObject * self, PyObject * args) {
|
||||
|
||||
@@ -2696,6 +2710,7 @@ static PyMethodDef uwsgi_advanced_methods[] = {
|
||||
{"send_message", py_uwsgi_send_message, METH_VARARGS, ""},
|
||||
{"send_multi_message", py_uwsgi_send_multi_message, METH_VARARGS, ""},
|
||||
{"reload", py_uwsgi_reload, METH_VARARGS, ""},
|
||||
{"stop", py_uwsgi_stop, METH_VARARGS, ""},
|
||||
{"workers", py_uwsgi_workers, METH_VARARGS, ""},
|
||||
{"masterpid", py_uwsgi_masterpid, METH_VARARGS, ""},
|
||||
{"total_requests", py_uwsgi_total_requests, METH_VARARGS, ""},
|
||||
|
||||
Reference in New Issue
Block a user