Skip to content

Commit

Permalink
return true on meeting appindicator reqs if exec fails, assume not us…
Browse files Browse the repository at this point in the history
…ing gnome
  • Loading branch information
James-Pickett committed Sep 13, 2023
1 parent 4136164 commit 9ab0ed3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ee/desktop/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ func (r *DesktopUsersProcessesRunner) runConsoleUserDesktop() error {
return nil
}

if runtime.GOOS == "linux" && !IsAppindicatorEnabled(context.Background()) {
if runtime.GOOS == "linux" && !IsMeetingGnomeAppindicatorRequirements(context.Background()) {
level.Info(r.logger).Log("msg", "no appindicator enabled, not running desktop")
r.killDesktopProcesses()
return nil
Expand Down Expand Up @@ -815,9 +815,10 @@ func removeFilesWithPrefix(folderPath, prefix string) error {
})
}

// IsAppindicatorEnabled iterates over known appindicator gnome-extensions for each user
// and returns true the first time it finds one enabled, false if none found enabled
func IsAppindicatorEnabled(ctx context.Context) bool {
// IsMeetingGnomeAppindicatorRequirements iterates over known appindicator gnome-extensions for each user
// and returns true the first time it finds one enabled, false if none found enabled.
// Returns true if exec of gnome-extensions fails, assumes user not using gnome.
func IsMeetingGnomeAppindicatorRequirements(ctx context.Context) bool {
uids, err := consoleuser.CurrentUids(ctx)
if err != nil {
return false
Expand Down Expand Up @@ -845,7 +846,8 @@ func IsAppindicatorEnabled(ctx context.Context) bool {
}

if err := cmd.Wait(); err != nil {
return false
// if we go an error here we are just assuming that the machine is not using gnome
return true
}

for _, extension := range extensions {
Expand Down

0 comments on commit 9ab0ed3

Please sign in to comment.