Feature #2594
closedimplement graceful shutdown for local zones in zoneadm
100%
Description
Currently there are the following options:
- "zoneadm -z ZONE halt" - aborts local zone processes ungracefully and revokes its resources (like poweroff)
- "zoneadm -z ZONE reboot" - aborts local zone processes ungracefully and restarts it
- "zlogin ZONE init 0" - gracefully shuts down the local zone, invoking its SMF stop methods and RC stop scripts
- "zlogin ZONE init 6" - gracefully shuts down the local zone, invoking its SMF stop methods and RC stop scripts, then halts and restarts it
The first part of the newly proposed feature is to implement a "zoneadm -Z shutdown (-r)" method for feature-parity with Solaris 11 (http://docs.oracle.com/cd/E23824_01/html/821-1462/zoneadm-1m.html):
shutdown [-r [-— boot_options]] Cleanly shut down the zone (equivalent to running /usr/sbin/init 0 in the zone). The shutdown subcommand waits until the zone is successfully shut down; a zoneadm halt can be used to forcibly halt the zone, if the shutdown process takes a long time. If -r is specified, reboot the zone. See the boot subcommand for supported boot options.
The second part of the quest is to update halt.c and/or bootadm.c to invoke "zoneadm shutdown" when stopping the global zone gracefully (unless the fast halt/poweroff/reboot method is requested in GZ explicitly to bypass all stop methods).
Otherwise server processes running in local zones receive a SIGTERM signal via LZ "zoneadm halt" invokation, and at most 30 seconds to complete (from halt.c, see http://src.illumos.org/source/xref/illumos-gate/usr/src/cmd/halt/halt.c#check_zones_haltedness). For certain processes, especially in distributed systems like databases and their application servers, this timeframe may be inadequate for a proper clean shutdown, and should not be forced by the OS -- the local zone shutdown should behave just like global zone shutdown in both graceful and ungraceful modes.
Updated by Alexander Eremin over 9 years ago
- Assignee set to Alexander Eremin
- % Done changed from 0 to 20
Updated by Alexander Eremin over 9 years ago
- Subject changed from Implement graceful shutdown for local zones in zoneadm, and use it for graceful shutdowns of global zone to implement graceful shutdown for local zones in zoneadm
Updated by Electric Monk over 9 years ago
git commit 3c7284bd3243d42a710edac3a15f6019b4c849be
Author: Alexander Eremin <a.eremin@nexenta.com> 2594 implement graceful shutdown for local zones in zoneadm Reviewed by: Saso Kiselkov <skiselkov.ml@gmail.com> Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com> Approved by: Dan McDonald <danmcd@omniti.com>
Updated by Alexander Eremin over 9 years ago
- Due date set to 2014-02-24
- Status changed from New to Resolved
- % Done changed from 20 to 100