Skip to content

Commit

Permalink
Fix issue trying to start profiles (#23)
Browse files Browse the repository at this point in the history
Abrupt stops of `qubesome start` leave behind lingering files which may
lead `qubesome` to think the profile is still running. To overcome this
issue, a new check was introduced to confirm that the container is
running before returning an error.
  • Loading branch information
pjbgf authored Dec 8, 2024
2 parents af6ac4a + 6fce34d commit f21dcef
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@ updates:
directory: "/"
schedule:
interval: "weekly"
groups:
golang.org:
patterns:
- "golang.org/*"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
groups:
github-actions-updates:
patterns:
- "*"
14 changes: 0 additions & 14 deletions .obs/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,3 @@ testbuild:
- aarch64
filters:
event: pull_request

rebuild:
steps:
- trigger_services:
project: home:pjbgf:devel:languages:go:unstable
package: qubesome
- rebuild_package:
project: home:pjbgf:devel:languages:go:unstable
package: qubesome
filters:
event: push
branches:
only:
- main
4 changes: 2 additions & 2 deletions internal/profiles/profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ func StartFromGit(runner, name, gitURL, path, local string) error {
ln := files.ProfileConfig(name)

if _, err := os.Lstat(ln); err == nil {
// Wayland is not cleaning up profile state after closure.
if !strings.EqualFold(os.Getenv("XDG_SESSION_TYPE"), "wayland") {
if container.Running(runner, fmt.Sprintf(ContainerNameFormat, name)) {
return fmt.Errorf("profile %q is already started", name)
}

if err = os.Remove(ln); err != nil {
return fmt.Errorf("failed to remove leftover profile symlink: %w", err)
}
Expand Down

0 comments on commit f21dcef

Please sign in to comment.