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 (from parent 1:
d257dde
)
main: rename process on startup to 'systemd' to avoid confusion
author
Lennart Poettering
<lennart@poettering.net>
Wed, 10 Nov 2010 21:35:05 +0000
(22:35 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 10 Nov 2010 21:39:33 +0000
(22:39 +0100)
src/main.c
patch
|
blob
|
history
diff --git
a/src/main.c
b/src/main.c
index cd73ee2cffd4d6f0a26f85fadde37182b1fac78d..ea2f0c1a9ecf3dc378257885ef96a86a34c7d86e 100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-31,6
+31,7
@@
#include <signal.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/wait.h>
#include <fcntl.h>
+#include <sys/prctl.h>
#include "manager.h"
#include "log.h"
#include "manager.h"
#include "log.h"
@@
-896,6
+897,7
@@
int main(int argc, char *argv[]) {
bool reexecute = false;
const char *shutdown_verb = NULL;
dual_timestamp initrd_timestamp = { 0ULL, 0ULL };
bool reexecute = false;
const char *shutdown_verb = NULL;
dual_timestamp initrd_timestamp = { 0ULL, 0ULL };
+ char systemd[] = "systemd";
if (getpid() != 1 && strstr(program_invocation_short_name, "init")) {
/* This is compatbility support for SysV, where
if (getpid() != 1 && strstr(program_invocation_short_name, "init")) {
/* This is compatbility support for SysV, where
@@
-907,6
+909,14
@@
int main(int argc, char *argv[]) {
return 1;
}
return 1;
}
+ /* If we get started via the /sbin/init symlink then we are
+ called 'init'. After a subsequent reexecution we are then
+ called 'systemd'. That is confusing, hence let's call us
+ systemd right-away. */
+
+ program_invocation_short_name = systemd;
+ prctl(PR_SET_NAME, systemd);
+
log_show_color(isatty(STDERR_FILENO) > 0);
log_show_location(false);
log_set_max_level(LOG_INFO);
log_show_color(isatty(STDERR_FILENO) > 0);
log_show_location(false);
log_set_max_level(LOG_INFO);