summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-04-10 05:00:38 +0200
committerLennart Poettering <lennart@poettering.net>2010-04-10 18:00:21 +0200
commit302e8c4c4c7c776531d33fddae9cc0cac90846c3 (patch)
tree22f29c6b03a036c20c218740a10834fd59f52b90 /main.c
parente293f0f07d0dcff74acf756a2b88d7bd949257a7 (diff)
hostname: set hostname early during boottime
Diffstat (limited to 'main.c')
-rw-r--r--main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/main.c b/main.c
index b4fbdb58f5..139770edec 100644
--- a/main.c
+++ b/main.c
@@ -32,6 +32,8 @@
#include "manager.h"
#include "log.h"
#include "mount-setup.h"
+#include "hostname-setup.h"
+#include "load-fragment.h"
static enum {
ACTION_RUN,
@@ -293,6 +295,10 @@ int main(int argc, char *argv[]) {
log_debug("systemd running in %s mode.", manager_running_as_to_string(running_as));
+ if (running_as == MANAGER_INIT)
+ if (hostname_setup() < 0)
+ goto finish;
+
if ((r = manager_new(running_as, &m)) < 0) {
log_error("Failed to allocate manager object: %s", strerror(-r));
goto finish;