mirror of
https://github.com/taigrr/systemctl.git
synced 2026-03-09 00:14:38 -07:00
helper functions added
This commit is contained in:
25
README.md
25
README.md
@@ -1,14 +1,17 @@
|
||||
# systemctl
|
||||
|
||||
This library aims at providing idiomatic `systemctl` bindings for go developers, in order to make it easier to write system tooling using golang.
|
||||
This tool tries to take guesswork out of arbitrarily shelling out to `systemctl` by providing a structured, throuroughly-tested wrapper for the `systemctl` functions most-likely to be used in a system program.
|
||||
|
||||
If your system isn't running (or targeting another system running) `systemctl`, this library will be of little use to you.
|
||||
|
||||
## What is systemctl
|
||||
|
||||
systemctl is a command-line program which grants the user control over the systemd system and service manager.
|
||||
`systemctl` is a command-line program which grants the user control over the systemd system and service manager.
|
||||
|
||||
systemctl may be used to introspect and control the state of the "systemd" system and service manager. Please refer to systemd(1) for an introduction into the basic concepts and functionality this tool manages.
|
||||
`systemctl` may be used to introspect and control the state of the "systemd" system and service manager. Please refer to `systemd(1)` for an introduction into the basic concepts and functionality this tool manages.
|
||||
|
||||
## Supported functions
|
||||
## Supported systemctl functions
|
||||
|
||||
- [ ] `systemctl is-failed`
|
||||
- [ ] `systemctl is-active`
|
||||
@@ -24,6 +27,22 @@ systemctl may be used to introspect and control the state of the "systemd" syste
|
||||
- [ ] `systemctl mask`
|
||||
- [ ] `systemctl unmask`
|
||||
|
||||
## Helper functionality
|
||||
|
||||
- [ ] Get start time of a service (`ExecMainStartTimestamp`) as a `Time` type
|
||||
- [ ] Get current memory in bytes (`MemoryCurrent`) an an int
|
||||
- [ ] Get the PID of the main process (`MainPID`) as an int
|
||||
|
||||
|
||||
## Useful errors
|
||||
|
||||
All functions return a predefinied error type, and it is highly recommended these errors are handled properly.
|
||||
|
||||
## Context support
|
||||
|
||||
All calls into this library support go's `context` functionality.
|
||||
Therefore, blocking calls can time out according to the callee's needs, and the returned error should be checked to see if a timeout occurred (`ErrExecTimeout`).
|
||||
|
||||
## TODO
|
||||
|
||||
- [ ] Add additional bindings for systemctl options I (the author) don't use frequently (or ever) for others to use.
|
||||
|
||||
Reference in New Issue
Block a user