Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions pkg/daemon/rpm-ostree.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"os"
"os/exec"
"path/filepath"
"strings"
"time"

Expand Down Expand Up @@ -99,6 +100,30 @@ func (r *RpmOstreeClient) loadStatus() (*rpmOstreeState, error) {
return &rosState, nil
}

// See https://bugzilla.redhat.com/show_bug.cgi?id=2111817
func bug2111817Workaround() error {
targetUnit := "/run/systemd/system/rpm-ostreed.service.d/bug2111817.conf"
// Do nothing if the file exists
if _, err := os.Stat(targetUnit); err == nil {
return nil
}
err := os.MkdirAll(filepath.Dir(targetUnit), 0o755)
if err != nil {
return err
}
dropin := `[Service]
InaccessiblePaths=
`
if err := writeFileAtomicallyWithDefaults(targetUnit, []byte(dropin)); err != nil {
return err
}
if err := runCmdSync("systemctl", "daemon-reload"); err != nil {
return err
}
glog.Infof("Enabled workaround for bug 2111817")
return nil
}

func (r *RpmOstreeClient) Initialize() error {
// This replicates https://github.com/coreos/rpm-ostree/pull/2945
// and can be removed when we have a new enough rpm-ostree with
Expand Down Expand Up @@ -132,6 +157,10 @@ func (r *RpmOstreeClient) Initialize() error {
}
}

if err := bug2111817Workaround(); err != nil {
return err
}

return nil
}

Expand Down