feat(system): add MaskUnit to systemd

This commit is contained in:
Brandon Philips
2014-05-06 16:18:36 -07:00
parent 85a473d972
commit c3f17bd07b
2 changed files with 27 additions and 0 deletions

View File

@@ -165,3 +165,11 @@ func MachineID(root string) string {
return id
}
func MaskUnit(unit string, root string) error {
masked := path.Join(root, "etc", "systemd", "system", unit)
if err := os.MkdirAll(path.Dir(masked), os.FileMode(0755)); err != nil {
return err
}
return os.Symlink("/dev/null", masked)
}