Commit 34e0ea4
committed
Write PID file in foreground mode when -P is explicitly given (#299)
When running with -E (foreground/non-daemon mode), the -P option was
silently ignored because write_pid_file() was only called inside the
DaemonMode code path. This caused no PID file to be created even when
-P was explicitly passed on the command line, which is the typical
setup for systemd service units using Type=simple.
Fix by writing the PID file in non-daemon mode when -P is present,
and tracking whether a PID file was written for proper cleanup on exit.1 parent 717f654 commit 34e0ea4
1 file changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
| 350 | + | |
350 | 351 | | |
351 | 352 | | |
352 | 353 | | |
| |||
542 | 543 | | |
543 | 544 | | |
544 | 545 | | |
| 546 | + | |
545 | 547 | | |
546 | 548 | | |
547 | 549 | | |
| |||
567 | 569 | | |
568 | 570 | | |
569 | 571 | | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
570 | 577 | | |
571 | 578 | | |
572 | 579 | | |
| |||
669 | 676 | | |
670 | 677 | | |
671 | 678 | | |
672 | | - | |
| 679 | + | |
673 | 680 | | |
674 | 681 | | |
675 | 682 | | |
| |||
0 commit comments