stratis-storage/stratis-cli

Distinguish cases where stratisd has actually failed to start from ones where it has failed to establish a D-Bus connection

Closed this issue · 3 comments

If the file /usr/lib/systemd/system/stratisd.service is missing the stratisd service will start, but will not be able to bring up the dbus interface. From a users perspective this could be confusing.

This would be a project wide issue, since no D-Bus means no ability of CLI to communicate.

On Fedora 31, and presumably above, the service won't start at all under these conditions. The CLI will attempt to communicate with the unstarted daemon, and will give the error it usually gives:

[amulhern@mulhern stratis-cli]$ PYTHONPATH=./src ./bin/stratis  pool listExecution failed:
Most likely stratis is unable to connect to the stratisd D-Bus service. 

This is a correct description of the problem. The CLI could work to find out more, like, is stratisd running at all, and give a more specific error message. Currently, we're not planning to do that, because it would make error reporting a bit more ornate and less uniform, but it is definitely doable w/ psutil. Moving to the CLI.

@lleshchi We need to decide whether we want the CLI to disambiguate between situations where stratisd is just not running, and other reasons for it not having made a D-Bus connection. If we decide we do want to disambiguate, then we'll use the psutil package to check if stratisd is running. So the solution is easy to implement; the decision is whether we want to or not. If we decide not, we'll just close the issue. If yes, then you can go ahead and implement the solution.