Commit b4678105 authored by Oxalica --'s avatar Oxalica -- Committed by David Edmundson
Browse files

[startplasma] Detect systemd service in linked state

Systemd units which are symlinked to the service directory will be in
`linked` or `linked-runtime` state. They are also available and
runnable. This can happen when the package manager uses symlinks to
install systemd units instead of copying them, like on NixOS.


(cherry picked from commit a6e513d0)
parent f6f97286
......@@ -445,7 +445,11 @@ bool hasSystemdService(const QString &serviceName)
QStringLiteral("/org/freedesktop/systemd1"),
QStringLiteral("org.freedesktop.systemd1.Manager"),
QStringLiteral("ListUnitFilesByPatterns"));
msg << QStringList({QStringLiteral("enabled"), QStringLiteral("static")}) << QStringList({serviceName});
msg << QStringList({QStringLiteral("enabled"),
QStringLiteral("static"),
QStringLiteral("linked"),
QStringLiteral("linked-runtime")});
msg << QStringList({serviceName});
QDBusReply<QList<QPair<QString, QString>>> reply = QDBusConnection::sessionBus().call(msg);
if (!reply.isValid()) {
return false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment