File: 1002_fix-reload-process-name.patch

package info (click to toggle)
uwsgi 2.0.31-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,564 kB
  • sloc: ansic: 87,066; python: 7,004; cpp: 1,133; java: 708; perl: 678; sh: 585; ruby: 555; makefile: 148; xml: 130; cs: 121; objc: 37; php: 28; erlang: 20; javascript: 11
file content (31 lines) | stat: -rw-r--r-- 1,004 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Description: Preserve process name on reload
 Function uwsgi_reload is using uwsgi.binary_path as first argument in
 execvp(). If the daemon is started through a symlink, uwsgi_reload will
 use that link's target and change the process name. With a different process
 name start-stop-daemon, used in init scripts, is unable to control the
 daemon.
Author: Janos Guljas <janos@debian.org>
Forwarded: not-needed
Last-Update: 2013-04-23
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/core/master_utils.c
+++ b/core/master_utils.c
@@ -537,7 +537,7 @@
 
 	uwsgi_log("running %s\n", uwsgi.binary_path);
 	uwsgi_flush_logs();
-	argv[0] = uwsgi.binary_path;
+	//argv[0] = uwsgi.binary_path;
 	//strcpy (argv[0], uwsgi.binary_path);
 	if (uwsgi.log_master) {
 		if (uwsgi.original_log_fd > -1) {
@@ -551,7 +551,7 @@
 			close(uwsgi.shared->worker_log_pipe[1]);
 		}
 	}
-	execvp(uwsgi.binary_path, argv);
+	execvp(argv[0], argv);
 	uwsgi_error("execvp()");
 	// never here
 	exit(1);