[systemd-commits] 2 commits - src/initctl.c src/service.c src/systemctl.c src/util.c src/util.h
Lennart Poettering
lennart at kemper.freedesktop.org
Tue Aug 23 17:29:47 PDT 2011
src/initctl.c | 2 ++
src/service.c | 2 +-
src/systemctl.c | 12 ------------
src/util.c | 12 ++++++++++++
src/util.h | 2 ++
5 files changed, 17 insertions(+), 13 deletions(-)
New commits:
commit 65457142f12ecc4bb39fad51b73b9d3e6eac4af5
Author: Frederic Crozat <fcrozat at suse.com>
Date: Mon Aug 22 14:58:50 2011 +0200
initctl: check for kexec_loaded when reboot is requested through initctl
diff --git a/src/initctl.c b/src/initctl.c
index f36f1cc..eaa717a 100644
--- a/src/initctl.c
+++ b/src/initctl.c
@@ -93,6 +93,8 @@ static const char *translate_runlevel(int runlevel, bool *isolate) {
for (i = 0; i < ELEMENTSOF(table); i++)
if (table[i].runlevel == runlevel) {
*isolate = table[i].isolate;
+ if (runlevel == '6' && kexec_loaded())
+ return SPECIAL_KEXEC_TARGET;
return table[i].special;
}
diff --git a/src/systemctl.c b/src/systemctl.c
index 604400d..0a35d8e 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -4427,18 +4427,6 @@ static int parse_time_spec(const char *t, usec_t *_u) {
return 0;
}
-static bool kexec_loaded(void) {
- bool loaded = false;
- char *s;
-
- if (read_one_line_file("/sys/kernel/kexec_loaded", &s) >= 0) {
- if (s[0] == '1')
- loaded = true;
- free(s);
- }
- return loaded;
-}
-
static int shutdown_parse_argv(int argc, char *argv[]) {
enum {
diff --git a/src/util.c b/src/util.c
index 65d4b14..6033aa0 100644
--- a/src/util.c
+++ b/src/util.c
@@ -5852,3 +5852,15 @@ static const char *const signal_table[] = {
};
DEFINE_STRING_TABLE_LOOKUP(signal, int);
+
+bool kexec_loaded(void) {
+ bool loaded = false;
+ char *s;
+
+ if (read_one_line_file("/sys/kernel/kexec_loaded", &s) >= 0) {
+ if (s[0] == '1')
+ loaded = true;
+ free(s);
+ }
+ return loaded;
+}
diff --git a/src/util.h b/src/util.h
index a6b700c..3e1f46d 100644
--- a/src/util.h
+++ b/src/util.h
@@ -504,4 +504,6 @@ int signal_from_string_try_harder(const char *s);
extern int saved_argc;
extern char **saved_argv;
+bool kexec_loaded(void);
+
#endif
commit 240fc26e03e93641523315222fea4cfbf71c0ef9
Author: Miklos Vajna <vmiklos at frugalware.org>
Date: Wed Aug 24 01:49:54 2011 +0200
service: all rcS.d scripts have been converted on Frugalware
diff --git a/src/service.c b/src/service.c
index f5ad509..abd8f36 100644
--- a/src/service.c
+++ b/src/service.c
@@ -65,7 +65,7 @@ static const struct {
{ "boot.d", SPECIAL_SYSINIT_TARGET, RUNLEVEL_SYSINIT },
#endif
-#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || defined(TARGET_FRUGALWARE) || defined(TARGET_ANGSTROM)
+#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || defined(TARGET_ANGSTROM)
/* Debian style rcS.d */
{ "rcS.d", SPECIAL_SYSINIT_TARGET, RUNLEVEL_SYSINIT },
#endif
More information about the systemd-commits
mailing list