diff --git a/services/init/standard/init.c b/services/init/standard/init.c index 3f7772b9687f28048cd33ce4c95ebba9e27664f0..d3d9d467d8d2402f793f0cf429cc62c63554623e 100755 --- a/services/init/standard/init.c +++ b/services/init/standard/init.c @@ -94,6 +94,10 @@ static int FdHolderSockInit(void) void SystemInit(void) { SignalInit(); + + // Set up a session keyring that all processes will have access to. + KeyCtrlGetKeyringId(KEY_SPEC_SESSION_KEYRING, 1); + // umask call always succeeds and return the previous mask value which is not needed here (void)umask(DEFAULT_UMASK_INIT); MakeDirRecursive("/dev/unix/socket", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); @@ -199,9 +203,6 @@ static void StartInitSecondStage(void) // It will panic if close stdio before execv("/bin/sh", NULL) CloseStdio(); - // Set up a session keyring that all processes will have access to. - KeyCtrlGetKeyringId(KEY_SPEC_SESSION_KEYRING, 1); - #ifndef DISABLE_INIT_TWO_STAGES INIT_LOGI("Start init second stage."); SwitchRoot("/usr");