mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
shell-util: Only use systemd if gnome-shell is managed by systemd
Simply looking at the return value of sd_pid_get_user_unit can be used
to determine if the process is in a systemd unit, but it doesn't say if
gnome-shell is managed by systemd.
For example, running toolbx on a host with systemd creates a libpod
unit, even if the gnome-shell that gets started in the toolbx is itself
not managed by systemd.
We can make sure that gnome-shell is managed by systemd simply by
checking if the unit we're running starts with org.gnome.Shell.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3267>
(cherry picked from commit b3580919e3)
This commit is contained in:
parent
0bacf38337
commit
c085170aac
1 changed files with 2 additions and 1 deletions
|
|
@ -677,7 +677,8 @@ shell_util_systemd_call (const char *command,
|
|||
*/
|
||||
res = sd_pid_get_user_unit (getpid (), &self_unit);
|
||||
|
||||
if (res == -ENODATA)
|
||||
if (res == -ENODATA ||
|
||||
(res >= 0 && !g_str_has_prefix (self_unit, "org.gnome.Shell")))
|
||||
{
|
||||
g_task_return_new_error (task,
|
||||
G_IO_ERROR,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue