mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-29 14:57:28 +03:00
Restart systemd if necessary
This commit is contained in:
parent
83c6b1cf3a
commit
4fa9b4b257
@ -232,7 +232,11 @@ my $res = 0;
|
||||
print STDERR "activating the configuration...\n";
|
||||
system("@out@/activate", "@out@") == 0 or $res = 2;
|
||||
|
||||
# FIXME: Re-exec systemd if necessary.
|
||||
# Restart systemd if necessary.
|
||||
if (abs_path("/proc/1/exe") ne abs_path("@systemd@/lib/systemd/systemd")) {
|
||||
print STDERR "restarting systemd...\n";
|
||||
system("@systemd@/bin/systemctl", "daemon-reexec") == 0 or $res = 2;
|
||||
}
|
||||
|
||||
# Forget about previously failed services.
|
||||
system("@systemd@/bin/systemctl", "reset-failed");
|
||||
|
Loading…
Reference in New Issue
Block a user