chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ec7f7f2
)
telinit: forward to upstart, if not booted with systemd
v4
author
Lennart Poettering
<lennart@poettering.net>
Sat, 24 Jul 2010 00:33:38 +0000
(
02:33
+0200)
committer
Lennart Poettering
<lennart@poettering.net>
Sat, 24 Jul 2010 00:33:38 +0000
(
02:33
+0200)
src/systemctl.c
patch
|
blob
|
history
diff --git
a/src/systemctl.c
b/src/systemctl.c
index d6b1fcd58102a399f33248e7c66bc086700cda1f..1640a60a70960131fc91a3adc9015665f4bb26a9 100644
(file)
--- a/
src/systemctl.c
+++ b/
src/systemctl.c
@@
-4209,8
+4209,22
@@
static int parse_argv(int argc, char *argv[]) {
arg_action = ACTION_POWEROFF;
return shutdown_parse_argv(argc, argv);
} else if (strstr(program_invocation_short_name, "init")) {
arg_action = ACTION_POWEROFF;
return shutdown_parse_argv(argc, argv);
} else if (strstr(program_invocation_short_name, "init")) {
- arg_action = ACTION_INVALID;
- return telinit_parse_argv(argc, argv);
+
+ if (sd_booted() > 0) {
+ arg_action = ACTION_INVALID;
+ return telinit_parse_argv(argc, argv);
+ } else {
+ /* Hmm, so some other init system is
+ * running, we need to forward this
+ * request to it. For now we simply
+ * guess that it is Upstart. */
+
+ execv("/lib/upstart/telinit", argv);
+
+ log_error("Couldn't find an alternative telinit implementation to spawn.");
+ return -EIO;
+ }
+
} else if (strstr(program_invocation_short_name, "runlevel")) {
arg_action = ACTION_RUNLEVEL;
return runlevel_parse_argv(argc, argv);
} else if (strstr(program_invocation_short_name, "runlevel")) {
arg_action = ACTION_RUNLEVEL;
return runlevel_parse_argv(argc, argv);