1
0
mirror of https://github.com/rancher/os.git synced 2025-06-28 07:46:49 +00:00
Commit Graph

29 Commits

Author SHA1 Message Date
Jason-ZW
788e9dc39a Add config validation when reboot & shutdown 2019-03-18 15:16:53 +08:00
niusmallnan
41277f7ca5 Use none network for power container 2019-01-08 15:19:08 +08:00
niusmallnan
823ae28a52 Imports are organized in groups, with blank lines between them
https://github.com/golang/go/wiki/CodeReviewComments#imports
2018-10-23 13:11:31 +08:00
niusmallnan
eeebf0ae0f Mount the boot partition when booting
Also update StateDir and OemDir for better clarity
2018-09-30 15:09:51 +08:00
Darren Shepherd
1f50386828 Move around code for better clarity 2018-09-19 17:18:49 +08:00
niusmallnan
1c2e55ed17
Fixes the following scenario can not reboot (#2236)
1. use ros install
2. use ros os upgrade
2018-01-25 16:25:09 +08:00
niusmallnan
b512a9336a Fix go fmt 2018-01-23 18:09:59 +08:00
niusmallnan
992142b8ea
Merge branch 'master' into shutdown-reboot-arg-fix 2018-01-23 18:01:29 +08:00
niusmallnan
2dda87e2c4 Fix the container name
https://github.com/rancher/os/issues/2176
2017-12-15 17:28:28 +08:00
Chris Marchesi
2f8eaa3314
cmd/power: Set correct container name and ensure full command executed
This fixes a few issues that are preventing shutdown and friends from
behaving correctly:

* The command name, which is being used to determine via what command it
was being called (ie: shutdown, reboot, or halt) was not being parsed
for absolute paths. This was preventing certain logic from being handled
(example: enforcing a static time value of "now" for shutdown), but more
problematically was the fact that it was being used as the container
name being passed to runDocker, the function that launches the
independent shutdown container. This was causing the shutdown container
to fail as something like "/sbin/shutdown" is not a valid name for a
container. The logic to parse out the base command being run is actually
present in runDocker, but does not run if a name is supplied to the
function.

* Further, the command line was not being parsed in the shutdown
container if the name supplied to runDocker was non-empty. Rather, the
full command to run just became the name of the container. Hence,
something like "/sbin/shutdown -h now" became just "shutdown", executing
the default power off behaviour for all actions (including reboots).

* Further to this, open-vm-tools expects "/sbin/shutdown -h now" to be a
valid command to halt the system, which was not being recognized as the
only recognized short-form halt flag in shutdown was its capital version
(-H).

This fixes these three issues by parsing out the base of the called
command before sending it to reboot, using all of os.Argv as the command
line to run regardless of if a name was set for the container or not,
and finally adding the lowercase -h switch to the "shutdown" form of
this command ("halt" is still uppercase only).

Fixes rancher/os#2121.
Fixes rancher/os#2074.
2017-10-20 17:09:13 -07:00
Sven Dowideit
c8915d646d add a timeout in case a system-container refuses to quit
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-07-31 03:20:09 +00:00
Sven Dowideit
67d932d9f8 Initial fix to stop other containers before the console
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-07-31 03:12:05 +00:00
Sven Dowideit
340bb42160 add kexec previous
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-07-06 15:50:14 +10:00
Sven Dowideit
c5d4cb91c3 reboot --kexec almost works
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2017-07-06 10:40:15 +10:00
Sven Dowideit
4df962d4b6 make ros log to dmesg
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2016-11-30 10:51:30 +10:00
Josh Curl
a7c34b9855
Fix golint errors 2016-11-28 00:06:00 -08:00
Josh Curl
719d255636
First class consoles 2016-06-06 15:13:15 -07:00
Darren Shepherd
a14846152b Update vendor 2016-05-31 18:14:32 -07:00
Josh Curl
42e48476e7 Sync with libcompose 2016-05-23 17:21:28 -07:00
Wang Long
9e15059789 Replace rancherio with rancher
Signed-off-by: Wang Long <long.wanglong@huawei.com>
2015-10-12 19:50:57 +08:00
Lucas Käldström
32f71c05bf Fixed 32-bit issue. Now it is possible to build bin/rancheros on a Raspberry Pi or any 32-bit machine 2015-09-10 10:33:15 +03:00
Ivan Mikushin
dff70f8362 latest rancher-compose, default.go -> os-config.yml
also, gofmt
2015-06-29 12:00:41 +05:00
Darren Shepherd
a051b1ad70 Reboot after os upgrade 2015-03-19 15:36:40 -07:00
Darren Shepherd
c0b02ca361 More graceful shutdown and sync before syscall 2015-03-18 06:45:21 -07:00
Darren Shepherd
e5192ddc5e Change reboot error messages and timeout 2015-02-23 14:52:11 -07:00
Darren Shepherd
1c5ac9f410 gofmt 2015-02-23 12:00:33 -07:00
sidharthamani
33d636930b refactor power and check for permissions 2015-02-21 12:22:59 -08:00
sidharthamani
7c44ed3e58 sync file system before making power syscalls 2015-02-20 10:48:18 -08:00
Darren Shepherd
81e15fc46f Move power to cmd 2015-02-19 13:56:33 -07:00