Add Conn.GetUnitOptions and/or Conn.Cat
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 2.7k
- Forks
- 338
- PR merge metrics
- No merged PRs in 30d
Description
Sometimes it is helpful to look at an enabled unit file. I'd rather not go look up the file in /etc/systemd, etc., which is kind of the point of using the Go bindings in the first place. :) At the commandline I can just run "systemctl cat ...". Having an equivalent method on dbus.Conn would really helpful. I expect it would dovetail onto work for issue #77.
As a temporary workaround I am reading the dbus properties I need (after hunting down the mapping from the conf directives) and manually converting them into unit.UnitOption values. From there I can use them or call unit.Serialize to get the unit file. However that's a lot of work, full of risk of getting something wrong (or out of date), for something that I would expect is not an out-of-the-ordinary need.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the dbus.Conn API and the work described in issue #77. Compare the requested behavior with the command-line systemctl cat operation and the existing unit.UnitOption and unit.Serialize usage. Done means Conn exposes an equivalent way to retrieve enabled unit contents or options without manually mapping D-Bus properties.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100