mirror of
https://github.com/troglobit/finit.git
synced 2026-10-30 12:50:34 +00:00
Fix #247: fall back to reboot -f in sulogin mode
When logged in from sulogin we cannot send IPC to Finit, not even signals, to delegate reboot. For usability, attempt to tell reboot that it's in sulogin mode -- provided the bundled sulogin is used -- to let reboot trigger over to forced reboot. We cannot do much about initctl, just document this as a limitation. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
0c4a9b62c2
commit
addb8c4019
5 files changed
+18
-1
No files matched your search
@@ -26,6 +26,7 @@
|
||||
#include <getopt.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include "util.h"
|
||||
@@ -159,6 +160,10 @@ int reboot_main(int argc, char *argv[])
|
||||
/* Check for any overrides */
|
||||
transform(NULL);
|
||||
|
||||
/* Check if we're in sulogin shell */
|
||||
if (getenv("SULOGIN"))
|
||||
force = 1;
|
||||
|
||||
if (force) {
|
||||
sync();
|
||||
|
||||
|
||||
Reference in new issue
Block a user