Commit 2af391f
committed
feat: avoid duplicate ll-package-manager startup by checking existing
connection
1. Add `startProcess` helper to launch detached processes with proper
environment and cleanup on exit.
2. Replace unconditional `startDetached` and sleep with a D-Bus peer
connection check to see if `ll-package-manager` is already running.
3. Only start a new process when no existing daemon is detected;
otherwise log reuse of existing instance.
4. Include signal handling to terminate spawned processes when the
application quits.
Log: Improved process management for ll-package-manager to prevent
duplicate instances.
Influence:
1. Verify that ll-package-manager starts correctly when not already
running.
2. Test that when ll-package-manager is already running, a new process
is not spawned.
3. Confirm that spawned processes are terminated when the main
application exits.
4. Check logging output for "reuse existing process" or "start"
messages.
5. Verify D-Bus connection to the peer socket works as expected.
6. Test in scenarios where the socket file might be stale or missing.1 parent e2a26de commit 2af391f
1 file changed
Lines changed: 40 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
50 | 72 | | |
51 | 73 | | |
52 | 74 | | |
| |||
692 | 714 | | |
693 | 715 | | |
694 | 716 | | |
695 | | - | |
696 | | - | |
697 | | - | |
698 | | - | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
705 | 735 | | |
706 | 736 | | |
707 | 737 | | |
| |||
0 commit comments