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

package info (click to toggle)
uwsgi 2.0.21-5.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,724 kB
  • sloc: ansic: 86,547; python: 6,255; sh: 1,387; cpp: 1,131; java: 708; perl: 646; ruby: 555; makefile: 471; xml: 130; cs: 121; objc: 37; erlang: 20; php: 14; javascript: 11
file content (30 lines) | stat: -rw-r--r-- 982 bytes parent folder | download | duplicates (4)
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
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>
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);