mirror of
https://github.com/taigrr/systemctl.git
synced 2025-10-10 18:50:25 +08:00
Migrates many tests to errors_test
This commit is contained in:
@@ -144,6 +144,9 @@ func IsFailed(ctx context.Context, unit string, opts Options) (bool, error) {
|
||||
|
||||
// Mask one or more units, as specified on the command line. This will link
|
||||
// these unit files to /dev/null, making it impossible to start them.
|
||||
//
|
||||
// Notably, Mask may return ErrDoesNotExist if a unit doesn't exist, but it will
|
||||
// ocntinue masking anyway.
|
||||
func Mask(ctx context.Context, unit string, opts Options) error {
|
||||
var args = []string{"mask", "--system", unit}
|
||||
if opts.UserMode {
|
||||
@@ -213,6 +216,11 @@ func Stop(ctx context.Context, unit string, opts Options) error {
|
||||
|
||||
// Unmask one or more unit files, as specified on the command line.
|
||||
// This will undo the effect of Mask.
|
||||
//
|
||||
// In line with systemd, Unmask will return ErrDoesNotExist if the unit
|
||||
// doesn't exist, but only if it's not already masked.
|
||||
// If the unit doesn't exist but it's masked anyway, no error will be
|
||||
// returned. Gross, I know. Take it up with Poettering.
|
||||
func Unmask(ctx context.Context, unit string, opts Options) error {
|
||||
var args = []string{"unmask", "--system", unit}
|
||||
if opts.UserMode {
|
||||
|
Reference in New Issue
Block a user