runc/libcontainer/system
W. Trevor King 2bea4c897e libcontainer/system/proc: Add Stat_t.State
And Stat_t.PID and Stat_t.Name while we're at it.  Then use the new
.State property in runType to distinguish between running and
zombie/dead processes, since kill(2) does not [1].  With this change
we no longer claim Running status for zombie/dead processes.

I've also removed the kill(2) call from runType.  It was originally
added in 13841ef3 (new-api: return the Running state only if the init
process is alive, 2014-12-23), but we've been accessing
/proc/[pid]/stat since 14e95b2a (Make state detection precise,
2016-07-05, #930), and with the /stat access the kill(2) check is
redundant.

I also don't see much point to the previously-separate
doesInitProcessExist, so I've inlined that logic in runType.

It would be nice to distinguish between "/proc/[pid]/stat doesn't
exist" and errors parsing its contents, but I've skipped that for the
moment.

The Running -> Stopped change in checkpoint_test.go is because the
post-checkpoint process is a zombie, and with this commit zombie
processes are Stopped (and no longer Running).

[1]: https://github.com/opencontainers/runc/pull/1483#issuecomment-307527789

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-06-20 16:26:55 -07:00
..
linux.go Use Prctl() from x/sys/unix instead of own wrapper 2017-06-07 15:03:15 +02:00
proc.go libcontainer/system/proc: Add Stat_t.State 2017-06-20 16:26:55 -07:00
proc_test.go libcontainer/system/proc: Add Stat_t.State 2017-06-20 16:26:55 -07:00
syscall_linux_64.go Move libcontainer to x/sys/unix 2017-05-22 17:35:20 -05:00
syscall_linux_386.go Move libcontainer to x/sys/unix 2017-05-22 17:35:20 -05:00
syscall_linux_arm.go Move libcontainer to x/sys/unix 2017-05-22 17:35:20 -05:00
sysconfig.go Cleanup GetLongBit 2016-08-02 09:04:30 +08:00
sysconfig_notcgo.go Move libcontainer into subdirectory 2015-06-21 19:29:15 -07:00
unsupported.go Stub RunningInUserNS for non-Linux 2016-03-03 16:33:43 -05:00
xattrs_linux.go Use symlink xattr functions from x/sys/unix 2017-05-31 13:50:34 +02:00