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
30 changes: 29 additions & 1 deletion pkg/daemon/rpm-ostree.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"os"
"os/exec"
"path/filepath"
"strings"
"time"

Expand Down Expand Up @@ -105,8 +106,35 @@ 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"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the relative urgency of the issue involved, I'm not against doing it this way, but this does come with the consideration of whether we want to eventually remove this service from nodes.

Put another way, would this work with a dropin file template shipped in 4.11 instead? Then we can just remove the template file when we want it gone

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the MCD is writing the file explicitly into /run. That means it's transient, and will go away on reboot (and be reapplied the next time the MCD lands - hence when we drop the workaround from the MCD, it will automatically go away).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah ok I see. That's fine then. I am +1 to shipping this since its only transient

// 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 used to have some workarounds for rpm-ostree bugs, but we no longer need those.
if err := bug2111817Workaround(); err != nil {
return err
}

return nil
}

Expand Down