Commit 5d87dd4
daemon: send stderr of service programs to the syslog
If git-daemon is run with --detach or --inetd, then stderr is explicitly
redirected to /dev/null. But notice that the service programs were spawned
via execl_git_cmd(), in particular, the stderr channel is inherited from
the daemon. This means that errors that the programs wrote to stderr (for
example, via die()), went to /dev/null.
This patch arranges that the daemon does not merely exec the service
program, but forks it and monitors stderr of the child; it writes the
errors that it produces to the daemons log via logerror().
A consequence is that the daemon process remains in memory for the full
duration of the service program, but this cannot be avoided.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 4f4fa9c commit 5d87dd4
1 file changed
Lines changed: 48 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
343 | 345 | | |
344 | 346 | | |
345 | 347 | | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
346 | 388 | | |
347 | 389 | | |
348 | 390 | | |
349 | 391 | | |
| 392 | + | |
350 | 393 | | |
351 | 394 | | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
| 395 | + | |
356 | 396 | | |
357 | 397 | | |
358 | 398 | | |
359 | 399 | | |
360 | | - | |
361 | | - | |
| 400 | + | |
| 401 | + | |
362 | 402 | | |
363 | 403 | | |
364 | 404 | | |
365 | 405 | | |
366 | | - | |
367 | | - | |
| 406 | + | |
| 407 | + | |
368 | 408 | | |
369 | 409 | | |
370 | 410 | | |
| |||
0 commit comments