Bug 377814 - KDBusService design inconvenient for Unique apps
Summary: KDBusService design inconvenient for Unique apps
Status: REPORTED
Alias: None
Product: frameworks-kdbusaddons
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 5.31.0
Platform: Kubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-19 20:13 UTC by Alexander Trufanov
Modified: 2025-07-13 18:41 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Trufanov 2017-03-19 20:13:05 UTC
I've played with KDBusService and got quite frustrated with its behavior. I have to look into its code to make it more clear for myself. It seems to not designed for Unique applications (where only one instance allowed) usage.

1. It uses exit() to terminate application if there is an instance already running. I would add a couple of notes into documentation regarding `exit` side effects as described here: http://stackoverflow.com/a/461528/841424

2. There is inconsistency in `activateRequested` signal. It was quite surprisingly to find that it passes empty arguments to signal if second instance was called without command line parameters. This better to be documented.

3. It ignores `setExitValue()` in case second instance was called without command line parameters. In this case second app will always exit with `exit(0)`. This better to be documented.

4. There is no reliable way to communicate the reason of exit of second instance to user. For example if I launch a demon and forget about it or it hangs. Then I launch secondary instance and it just exits. Sometimes with 0 exit value. And no chance to inform about reason. I think there should be a second signal that emitted in duplicate processes just before `exit()` call to let them do something like `cerr << "Error: Only one instance of application may be launched." and specify exit value by themselves.