[arch-general] Restart systemd related services on update
Hello everybody, on systemd package update systemd.install is run, which calls 'systemctl --system daemon-reexec'. This replaces pid 1 with a new process of updated systemd. However systemd comes with a lot of helper daemons (systemd-udevd, systemd-journald, systemd-logind, ...). These are not restarted. For systemd-213-9 systemd-udevd has a device-mapper fix that takes place only if system is rebooted or 'systemd restart systemd-udevd' is run manually. Any reason this is not done automatically? -- main(a){char*c=/* Schoene Gruesse */"B?IJj;MEH" "CX:;",b;for(a/* Chris get my mail address: */=0;b=c[a++];) putchar(b-1/(/* gcc -o sig sig.c && ./sig */b/42*2-3)*42);}
From: Christian Hesse <mail@eworm.de> --- systemd.install | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/systemd.install b/systemd.install index 5c370f7..11e97bc 100644 --- a/systemd.install +++ b/systemd.install @@ -27,6 +27,12 @@ maybe_reexec() { if sd_booted; then systemctl --system daemon-reexec + + for SERVICE in systemd-journald systemd-logind systemd-machined systemd-networkd systemd-resolved systemd-udevd; do + if systemctl is-active ${SERVICE} >/dev/null; then + systemctl restart ${SERVICE} + fi + done fi } -- 2.0.0
Hi, On Wed, Jun 11, 2014 at 12:15:18PM +0200, Christian Hesse wrote:
Date: Wed, 11 Jun 2014 12:15:18 +0200 From: Christian Hesse <list@eworm.de> To: arch-general <arch-general@archlinux.org> Cc: Christian Hesse <mail@eworm.de> Subject: [arch-general] [PATCH 1/1] systemd: restart services after update X-Mailer: git-send-email 2.0.0
From: Christian Hesse <mail@eworm.de>
--- systemd.install | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/systemd.install b/systemd.install index 5c370f7..11e97bc 100644 --- a/systemd.install +++ b/systemd.install @@ -27,6 +27,12 @@ maybe_reexec() {
if sd_booted; then systemctl --system daemon-reexec + + for SERVICE in systemd-journald systemd-logind systemd-machined systemd-networkd systemd-resolved systemd-udevd; do + if systemctl is-active ${SERVICE} >/dev/null; then + systemctl restart ${SERVICE} + fi + done fi }
Are you sure it's a good idea to restart things like that? Because this assumes that these daemons are independent -- is this a valid assumption? It seems that systemctl daemon-reexec _should_ reexec itself and its flock of helpers... Thanks, -- Leonid Isaev GPG fingerprints: DA92 034D B4A8 EC51 7EA6 20DF 9291 EE8A 043C B8C4 C0DF 20D0 C075 C3F1 E1BE 775A A7AE F6CB 164B 5A6D
Leonid Isaev <lisaev@umail.iu.edu> on Wed, 2014/06/11 12:13:
Hi,
On Wed, Jun 11, 2014 at 12:15:18PM +0200, Christian Hesse wrote:
Date: Wed, 11 Jun 2014 12:15:18 +0200 From: Christian Hesse <list@eworm.de> To: arch-general <arch-general@archlinux.org> Cc: Christian Hesse <mail@eworm.de> Subject: [arch-general] [PATCH 1/1] systemd: restart services after update X-Mailer: git-send-email 2.0.0
From: Christian Hesse <mail@eworm.de>
--- systemd.install | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/systemd.install b/systemd.install index 5c370f7..11e97bc 100644 --- a/systemd.install +++ b/systemd.install @@ -27,6 +27,12 @@ maybe_reexec() {
if sd_booted; then systemctl --system daemon-reexec + + for SERVICE in systemd-journald systemd-logind systemd-machined systemd-networkd systemd-resolved systemd-udevd; do + if systemctl is-active ${SERVICE} >/dev/null; then + systemctl restart ${SERVICE} + fi + done fi }
Are you sure it's a good idea to restart things like that? Because this assumes that these daemons are independent -- is this a valid assumption? It seems that systemctl daemon-reexec _should_ reexec itself and its flock of helpers...
I do not know if it is a good idea... At least restarting systemd-udevd manually did not have a bad impact. -- main(a){char*c=/* Schoene Gruesse */"B?IJj;MEH" "CX:;",b;for(a/* Chris get my mail address: */=0;b=c[a++];) putchar(b-1/(/* gcc -o sig sig.c && ./sig */b/42*2-3)*42);}
On Wed, Jun 11, 2014 at 12:15 PM, Christian Hesse <list@eworm.de> wrote:
From: Christian Hesse <mail@eworm.de>
--- systemd.install | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/systemd.install b/systemd.install index 5c370f7..11e97bc 100644 --- a/systemd.install +++ b/systemd.install @@ -27,6 +27,12 @@ maybe_reexec() {
if sd_booted; then systemctl --system daemon-reexec + + for SERVICE in systemd-journald systemd-logind systemd-machined systemd-networkd systemd-resolved systemd-udevd; do + if systemctl is-active ${SERVICE} >/dev/null; then + systemctl restart ${SERVICE} + fi + done fi }
-- 2.0.0
I don't like the idea of restarting _any_ daemons at all. It should be up to user to decide when a daemon is restarted.
Am 11.06.2014 19:23, schrieb Lukas Jirkovsky:
On Wed, Jun 11, 2014 at 12:15 PM, Christian Hesse <list@eworm.de> wrote:
From: Christian Hesse <mail@eworm.de>
--- [...] + for SERVICE in systemd-journald systemd-logind systemd-machined systemd-networkd systemd-resolved systemd-udevd; do + if systemctl is-active ${SERVICE} >/dev/null; then + systemctl restart ${SERVICE} + fi + done [...] I don't like the idea of restarting _any_ daemons at all. It should be up to user to decide when a daemon is restarted.
In my opinion restarting systemd-logind is a bad idea. What happens to an open session if the session manager restarts?
participants (4)
-
Christian Hesse
-
Leonid Isaev
-
Lukas Jirkovsky
-
ProgAndy