refractor: move default systemd drop in files.

This commit is contained in:
Alexandre Pujol 2023-11-19 14:20:14 +00:00
parent d1c8471b1d
commit f564347580
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
11 changed files with 12 additions and 0 deletions

View file

@ -173,6 +173,11 @@ func SetFlags() error {
return nil
}
// Set systemd unit drop in files to ensure some service start after apparmor
func SetDefaultSystemd() error {
return copyTo(paths.New("systemd/default/"), Root.Join("systemd"))
}
// Set AppArmor for (experimental) full system policy.
// See https://apparmor.pujol.io/development/structure/#full-system-policy
func SetFullSystemPolicy() error {

View file

@ -71,6 +71,9 @@ func copyTo(src *paths.Path, dst *paths.Path) error {
return err
}
destination = dst.JoinPath(destination)
if err := destination.Parent().MkdirAll(); err != nil {
return err
}
if err := file.CopyTo(destination); err != nil {
return err
}