mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-24 21:34:08 +03:00
core: turn our four vacuum calls into a new helper function
Just share some code. No functional changes.
This commit is contained in:
parent
1fb70e6648
commit
5197be06e0
@ -1581,6 +1581,20 @@ static void manager_preset_all(Manager *m) {
|
|||||||
log_info("Populated /etc with preset unit settings.");
|
log_info("Populated /etc with preset unit settings.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void manager_vacuum(Manager *m) {
|
||||||
|
assert(m);
|
||||||
|
|
||||||
|
/* Release any dynamic users no longer referenced */
|
||||||
|
dynamic_user_vacuum(m, true);
|
||||||
|
|
||||||
|
/* Release any references to UIDs/GIDs no longer referenced, and destroy any IPC owned by them */
|
||||||
|
manager_vacuum_uid_refs(m);
|
||||||
|
manager_vacuum_gid_refs(m);
|
||||||
|
|
||||||
|
/* Release any runtimes no longer referenced */
|
||||||
|
exec_runtime_vacuum(m);
|
||||||
|
}
|
||||||
|
|
||||||
int manager_startup(Manager *m, FILE *serialization, FDSet *fds) {
|
int manager_startup(Manager *m, FILE *serialization, FDSet *fds) {
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
@ -1662,14 +1676,8 @@ int manager_startup(Manager *m, FILE *serialization, FDSet *fds) {
|
|||||||
/* Third, fire things up! */
|
/* Third, fire things up! */
|
||||||
manager_coldplug(m);
|
manager_coldplug(m);
|
||||||
|
|
||||||
/* Release any dynamic users no longer referenced */
|
/* Clean up runtime objects */
|
||||||
dynamic_user_vacuum(m, true);
|
manager_vacuum(m);
|
||||||
|
|
||||||
/* Release any references to UIDs/GIDs no longer referenced, and destroy any IPC owned by them */
|
|
||||||
manager_vacuum_uid_refs(m);
|
|
||||||
manager_vacuum_gid_refs(m);
|
|
||||||
|
|
||||||
exec_runtime_vacuum(m);
|
|
||||||
|
|
||||||
if (serialization) {
|
if (serialization) {
|
||||||
assert(m->n_reloading > 0);
|
assert(m->n_reloading > 0);
|
||||||
@ -3540,14 +3548,8 @@ int manager_reload(Manager *m) {
|
|||||||
/* Third, fire things up! */
|
/* Third, fire things up! */
|
||||||
manager_coldplug(m);
|
manager_coldplug(m);
|
||||||
|
|
||||||
/* Release any dynamic users no longer referenced */
|
/* Clean up runtime objects no longer referenced */
|
||||||
dynamic_user_vacuum(m, true);
|
manager_vacuum(m);
|
||||||
|
|
||||||
/* Release any references to UIDs/GIDs no longer referenced, and destroy any IPC owned by them */
|
|
||||||
manager_vacuum_uid_refs(m);
|
|
||||||
manager_vacuum_gid_refs(m);
|
|
||||||
|
|
||||||
exec_runtime_vacuum(m);
|
|
||||||
|
|
||||||
/* Consider the reload process complete now. */
|
/* Consider the reload process complete now. */
|
||||||
assert(m->n_reloading > 0);
|
assert(m->n_reloading > 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user