[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[shepherd] branch master updated: shepherd: Upon 'quit', reboot only if
From: |
Ludovic Courtès |
Subject: |
[shepherd] branch master updated: shepherd: Upon 'quit', reboot only if we're running as PID 1. |
Date: |
Sat, 05 Feb 2022 08:50:57 -0500 |
This is an automated email from the git hooks/post-receive script.
civodul pushed a commit to branch master
in repository shepherd.
The following commit(s) were added to refs/heads/master by this push:
new 7c38059 shepherd: Upon 'quit', reboot only if we're running as PID 1.
7c38059 is described below
commit 7c380590164ea8ee40de46059d07e08a48963577
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat Feb 5 14:50:09 2022 +0100
shepherd: Upon 'quit', reboot only if we're running as PID 1.
Reported by Arun Isaac <arunisaac@systemreboot.net>.
* modules/shepherd.scm (quit-exception-handler): Reboot if and only
if (getpid) returns 1.
---
modules/shepherd.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/shepherd.scm b/modules/shepherd.scm
index 9f80f62..4747733 100644
--- a/modules/shepherd.scm
+++ b/modules/shepherd.scm
@@ -1,5 +1,5 @@
;; shepherd.scm -- The daemon shepherd.
-;; Copyright (C) 2013, 2014, 2016, 2018, 2019, 2020 Ludovic Courtès
<ludo@gnu.org>
+;; Copyright (C) 2013-2014, 2016, 2018-2020, 2022 Ludovic Courtès
<ludo@gnu.org>
;; Copyright (C) 2002, 2003 Wolfgang Jährling <wolfgang@pro-linux.de>
;; Copyright (C) 2018 Carlo Zancanaro <carlo@zancanaro.id.au>
;; Copyright (C) 2018 Danny Milosavljevic <dannym@scratchpost.org>
@@ -406,7 +406,7 @@ already ~a threads running, disabling 'signalfd' support")
;; Most likely we're receiving 'quit' from the 'stop' method of
;; ROOT-SERVICE. So, if we're running as 'root', just reboot.
- (if (zero? (getuid))
+ (if (and (zero? (getuid)) (= 1 (getpid)))
(begin
(local-output (l10n "Rebooting..."))
(reboot))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [shepherd] branch master updated: shepherd: Upon 'quit', reboot only if we're running as PID 1.,
Ludovic Courtès <=