mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2024-12-24 22:16:41 +01:00
refractor: move default systemd drop in files.
This commit is contained in:
parent
d1c8471b1d
commit
f564347580
11 changed files with 12 additions and 0 deletions
|
@ -47,6 +47,8 @@ func aaPrebuild() error {
|
||||||
|
|
||||||
if full {
|
if full {
|
||||||
prebuild.Prepares = append(prebuild.Prepares, prebuild.SetFullSystemPolicy)
|
prebuild.Prepares = append(prebuild.Prepares, prebuild.SetFullSystemPolicy)
|
||||||
|
} else {
|
||||||
|
prebuild.Prepares = append(prebuild.Prepares, prebuild.SetDefaultSystemd)
|
||||||
}
|
}
|
||||||
if complain {
|
if complain {
|
||||||
prebuild.Builds = append(prebuild.Builds, prebuild.BuildComplain)
|
prebuild.Builds = append(prebuild.Builds, prebuild.BuildComplain)
|
||||||
|
|
|
@ -173,6 +173,11 @@ func SetFlags() error {
|
||||||
return nil
|
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.
|
// Set AppArmor for (experimental) full system policy.
|
||||||
// See https://apparmor.pujol.io/development/structure/#full-system-policy
|
// See https://apparmor.pujol.io/development/structure/#full-system-policy
|
||||||
func SetFullSystemPolicy() error {
|
func SetFullSystemPolicy() error {
|
||||||
|
|
|
@ -71,6 +71,9 @@ func copyTo(src *paths.Path, dst *paths.Path) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
destination = dst.JoinPath(destination)
|
destination = dst.JoinPath(destination)
|
||||||
|
if err := destination.Parent().MkdirAll(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
if err := file.CopyTo(destination); err != nil {
|
if err := file.CopyTo(destination); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
2
systemd/default/system/systemd-userdbd.service
Normal file
2
systemd/default/system/systemd-userdbd.service
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[Unit]
|
||||||
|
After=apparmor.service
|
Loading…
Reference in a new issue