Bug 488178 - Baloo file daemon started using outdated QProcess API
Summary: Baloo file daemon started using outdated QProcess API
Status: CONFIRMED
Alias: None
Product: frameworks-baloo
Classification: Frameworks and Libraries
Component: Baloo File Daemon (show other bugs)
Version: 6.3.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: baloo-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-07 19:50 UTC by David Edmundson
Modified: 2025-03-24 06:36 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Edmundson 2024-06-07 19:50:48 UTC
Baloo is started manually in the following places with QProcess::startDetached
 - balooctl
 - qml monitor bindings
 - kcm (plasma-desktop)

This is problematic as it skips all features systemctl --user kde-baloo.service provides.
I strongly suspect this is how we end up with services not cleaned up properly.

This all needs porting to systemd startUnit/stopUnit with QProcess as a fallback for legacy support.

relevant code will be:
```
        auto msg = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.systemd1"),
                                                  QStringLiteral("/org/freedesktop/systemd1"),
                                                  QStringLiteral("org.freedesktop.systemd1.Manager"),
                                                  QStringLiteral("StartUnit"));
        msg << "kde-baloo.service" << QStringLiteral("fail");


    auto msg = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.systemd1"),
                                              QStringLiteral("/org/freedesktop/systemd1"),
                                              QStringLiteral("org.freedesktop.systemd1.Manager"),
                                              QStringLiteral("StopUnit"));
    msg << QStringLiteral("kde-baloo.service") << QStringLiteral("fail");
    QDBusConnection::sessionBus().call(msg);
```
Comment 1 tagwerk19 2024-06-07 23:02:53 UTC
This would be good...
Comment 2 tagwerk19 2024-06-11 07:19:01 UTC
Maybe also bundle up Bug 419708 in the change ...

... it seems strange to have to "balooctl enable" twice to get it to work.
Comment 3 skierpage 2025-03-24 06:36:53 UTC
(In reply to David Edmundson from comment #0)
> Baloo is started manually in the following places with
> QProcess::startDetached
>  - balooctl
>  - qml monitor bindings
>  - kcm (plasma-desktop)
> 
> This is problematic as it skips all features systemctl --user
> kde-baloo.service provides.

I think the workaround is
  # Make sure baloo thinks it should be running.
  % balooctl6 enable
   # Stop the baloo systemd unit.
  % systemctl --user stop kde-baloo
  # Make sure baloo's processes (baloo_file and baloo_file_extractor) are actually killed.
  % pkill --echo baloo_file
  # Restart the baloo systemd.unit
  % systemctl --user start kde-baloo