openrc-shutdown: move to single user mode by default
To be more compatible with sysvinit, move to single user mode if no options are specified on the command line.
This commit is contained in:
parent
a77ee2e941
commit
0cfd0dd9ef
@ -8,7 +8,7 @@
|
|||||||
.\" This file may not be copied, modified, propagated, or distributed
|
.\" This file may not be copied, modified, propagated, or distributed
|
||||||
.\" except according to the terms contained in the LICENSE file.
|
.\" except according to the terms contained in the LICENSE file.
|
||||||
.\"
|
.\"
|
||||||
.Dd April 6, 2017
|
.Dd May 22, 2017
|
||||||
.Dt openrc-shutdown 8 SMM
|
.Dt openrc-shutdown 8 SMM
|
||||||
.Os OpenRC
|
.Os OpenRC
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -40,6 +40,9 @@ upgrade of OpenRC if you are using openrc-init as your init process.
|
|||||||
.It Fl r , -reboot
|
.It Fl r , -reboot
|
||||||
Stop all services, kill all processes and reboot the system.
|
Stop all services, kill all processes and reboot the system.
|
||||||
.El
|
.El
|
||||||
|
.Pp
|
||||||
|
If none of these options are given, the default is to move the system
|
||||||
|
into single user mode.
|
||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
.Xr openrc-init 8 ,
|
.Xr openrc-init 8 ,
|
||||||
.Xr kexec 8 ,
|
.Xr kexec 8 ,
|
||||||
|
@ -114,7 +114,7 @@ if (geteuid() != 0)
|
|||||||
case_RC_COMMON_GETOPT
|
case_RC_COMMON_GETOPT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cmd_count != 1) {
|
if (cmd_count > 1) {
|
||||||
eerror("%s: %s\n", applet, exclusive);
|
eerror("%s: %s\n", applet, exclusive);
|
||||||
usage(EXIT_FAILURE);
|
usage(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
@ -128,5 +128,7 @@ if (geteuid() != 0)
|
|||||||
send_cmd("reboot");
|
send_cmd("reboot");
|
||||||
else if (do_reexec)
|
else if (do_reexec)
|
||||||
send_cmd("reexec");
|
send_cmd("reexec");
|
||||||
|
else
|
||||||
|
send_cmd("single");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user