From a6a0cdf53dd518383e653191cc680a550e99fef6 Mon Sep 17 00:00:00 2001 From: Zhao Lei Date: Tue, 24 May 2016 16:47:59 +0800 Subject: [PATCH 1/8] manual: Use SYNOPSIS instead of USAGE in man/runc-checkpoint.8.md Reason1: other runc manual are using word of "SYNOPSIS" # grep USAGE man/* # man/runc-checkpoint.8.md:#USAGE # # grep SYNOPSIS man/* man/runc-checkpoint.8.md:# SYNOPSIS man/runc-delete.8.md:# SYNOPSIS man/runc-events.8.md:# SYNOPSIS man/runc-exec.8.md:# SYNOPSIS man/runc-kill.8.md:# SYNOPSIS man/runc-list.8.md:# SYNOPSIS man/runc-pause.8.md:# SYNOPSIS man/runc-restore.8.md:# SYNOPSIS man/runc-resume.8.md:# SYNOPSIS man/runc-spec.8.md:# SYNOPSIS man/runc-start.8.md:# SYNOPSIS man/runc-state.8.md:# SYNOPSIS man/runc-update.8.md:# SYNOPSIS man/runc.8.md:# SYNOPSIS # Reason2: Most linux commands are using word of "SYNOPSIS" # man ls # man find # ... Signed-off-by: Zhao Lei --- man/runc-checkpoint.8.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/runc-checkpoint.8.md b/man/runc-checkpoint.8.md index 6dc7b889..44fbedee 100644 --- a/man/runc-checkpoint.8.md +++ b/man/runc-checkpoint.8.md @@ -1,7 +1,7 @@ # NAME runc checkpoint - checkpoint a running container -# USAGE +# SYNOPSIS runc checkpoint [command options] Where "" is the name for the instance of the container to be From 8cd952f0a21c0e640eebe00105bc87c0e785bd35 Mon Sep 17 00:00:00 2001 From: Zhao Lei Date: Tue, 24 May 2016 16:59:24 +0800 Subject: [PATCH 2/8] manual: Unify EXAMPLE title in code and manual There are 3 types of EXAMPLE title in manual and code: 1: "# EXAMPLE" runc-delete.8.md runc-exec.8.md runc-kill.8.md 2: "EXAMPE:" runc-spec.8.md 3: EXAMPLE title exist in manual, but not exist in code's --help output delete.go exec.go kill.go This patch unified above format, and deleted some useless blanks. Signed-off-by: Zhao Lei --- delete.go | 3 ++- exec.go | 1 + kill.go | 3 ++- man/runc-spec.8.md | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/delete.go b/delete.go index e9751669..17d5c2fa 100644 --- a/delete.go +++ b/delete.go @@ -16,7 +16,8 @@ var deleteCommand = cli.Command{ ArgsUsage: ` Where "" is the name for the instance of the container. - + +EXAMPLE: For example, if the container id is "ubuntu01" and runc list currently shows the status of "ubuntu01" as "destroyed" the following will delete resources held for "ubuntu01" removing "ubuntu01" from the runc list of containers: diff --git a/exec.go b/exec.go index d4ca6274..11cfceff 100644 --- a/exec.go +++ b/exec.go @@ -22,6 +22,7 @@ var execCommand = cli.Command{ Where "" is the name for the instance of the container and "" is the command to be executed in the container. +EXAMPLE: For example, if the container is configured to run the linux ps command the following will output a list of processes running in the container: diff --git a/kill.go b/kill.go index 104354d8..e311bedd 100644 --- a/kill.go +++ b/kill.go @@ -56,7 +56,8 @@ var killCommand = cli.Command{ Where "" is the name for the instance of the container and "" is the signal to be sent to the init process. - + +EXAMPLE: For example, if the container id is "ubuntu01" the following will send a "KILL" signal to the init process of the "ubuntu01" container: diff --git a/man/runc-spec.8.md b/man/runc-spec.8.md index 482c8c3a..831f699a 100644 --- a/man/runc-spec.8.md +++ b/man/runc-spec.8.md @@ -14,7 +14,7 @@ parameter that is initially set to call the "sh" command when the container is started. Calling "sh" may work for an ubuntu container or busybox, but will not work for containers that do not include the "sh" program. -EXAMPLE: +# EXAMPLE To run docker's hello-world container one needs to set the args parameter in the spec to call hello. This can be done using the sed command or a text editor. The following commands create a bundle for hello-world, change the From f6e4d7ba7c2a2022f1166fbbffe63e595faff032 Mon Sep 17 00:00:00 2001 From: Zhao Lei Date: Tue, 24 May 2016 17:08:37 +0800 Subject: [PATCH 3/8] manual: Update runc-events.8.md with source --events argument's usage was updated by: commit:a62dbf48b0fe5e2e28e3cc9dc80a70d2ec5ebc25 We need to update manual together. This patch also removes last useless blank line in manual. Signed-off-by: Zhao Lei --- man/runc-events.8.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/man/runc-events.8.md b/man/runc-events.8.md index 10385e9b..f61eb883 100644 --- a/man/runc-events.8.md +++ b/man/runc-events.8.md @@ -1,5 +1,5 @@ # NAME - runc events - display container events such as OOM notifications, cpu, memory, IO and network stats + runc events - display container events such as OOM notifications, cpu, memory, and IO usage statistics # SYNOPSIS runc events [command options] @@ -13,4 +13,3 @@ information is displayed once every 5 seconds. # OPTIONS --interval "5s" set the stats collection interval --stats display the container's stats then exit - From aedafa9965c5355a9998a3ad7cc2b5cec22adc1d Mon Sep 17 00:00:00 2001 From: Zhao Lei Date: Tue, 24 May 2016 17:15:22 +0800 Subject: [PATCH 4/8] manual: runc-exec: Add losted --no-subreaper argument --no-subreaper's description exist in code but not in manual: # ./runc exec --help ... OPTIONS: ... --no-subreaper disable the use of the subreaper used to reap reparented processes # Signed-off-by: Zhao Lei --- man/runc-exec.8.md | 1 + 1 file changed, 1 insertion(+) diff --git a/man/runc-exec.8.md b/man/runc-exec.8.md index d75db78b..c428bbd6 100644 --- a/man/runc-exec.8.md +++ b/man/runc-exec.8.md @@ -26,3 +26,4 @@ following will output a list of processes running in the container: --apparmor set the apparmor profile for the process --no-new-privs set the no new privileges value for the process --cap, -c [--cap option --cap option] add a capability to the bounding set for the process + --no-subreaper disable the use of the subreaper used to reap reparented processes From 7d5779fdee6be3e95ac318006d5c3661ec463d90 Mon Sep 17 00:00:00 2001 From: Zhao Lei Date: Tue, 24 May 2016 17:30:43 +0800 Subject: [PATCH 5/8] manual: list: Move description contents into OPTIONS field The description contents in manual is for --format argument actually, see: # ./runc list --help ... OPTIONS: --format, -f select one of: table or json. The default format is table. The following will output the list of containers in json format: # runc list -f json --quiet, -q display only container IDs # This patch move above content into right place, and remove the command example which is not necessary. Suggested-by: Aleksa Sarai Signed-off-by: Zhao Lei --- list.go | 9 ++------- man/runc-list.8.md | 8 +------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/list.go b/list.go index 5b1d464e..627310d6 100644 --- a/list.go +++ b/list.go @@ -16,7 +16,7 @@ import ( "github.com/opencontainers/runc/libcontainer/utils" ) -const formatOptions = `table or json` +const formatOptions = `table(default) or json` // containerState represents the platform agnostic pieces relating to a // running container's status and state @@ -40,12 +40,7 @@ var listCommand = cli.Command{ cli.StringFlag{ Name: "format, f", Value: "", - Usage: `select one of: ` + formatOptions + `. - -The default format is table. The following will output the list of containers -in json format: - - # runc list -f json`, + Usage: `select one of: ` + formatOptions, }, cli.BoolFlag{ Name: "quiet, q", diff --git a/man/runc-list.8.md b/man/runc-list.8.md index a41a6526..61696238 100644 --- a/man/runc-list.8.md +++ b/man/runc-list.8.md @@ -4,12 +4,6 @@ # SYNOPSIS runc list [command options] [arguments...] -# DESCRIPTION - The default format is table. The following will output the list of containers -in json format: - - # runc list -f json - # OPTIONS - --format, -f select one of: table or json. + --format, -f select one of: table(default) or json. --quiet, -q display only container IDs From f5b674c914983a6ceb72cb09cc766bfa0f932355 Mon Sep 17 00:00:00 2001 From: Zhao Lei Date: Tue, 24 May 2016 17:37:20 +0800 Subject: [PATCH 6/8] manual: restore: Update contents with source This patch add losted --no-subreaper and --no-pivot options in manual: # ./runc restore --help .. OPTIONS: ... --no-subreaper disable the use of the subreaper used to reap reparented processes --no-pivot do not use pivot root to jail process inside rootfs. This should be used whenever the rootfs is on top of a ramdisk # Signed-off-by: Zhao Lei --- man/runc-restore.8.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/man/runc-restore.8.md b/man/runc-restore.8.md index b0dec455..b10ae110 100644 --- a/man/runc-restore.8.md +++ b/man/runc-restore.8.md @@ -22,3 +22,5 @@ using the runc checkpoint command. --bundle, -b path to the root of the bundle directory --detach, -d detach from the container's process --pid-file specify the file to write the process id to + --no-subreaper disable the use of the subreaper used to reap reparented processes + --no-pivot do not use pivot root to jail process inside rootfs. This should be used whenever the rootfs is on top of a ramdisk From 935eba1cc1872cdc00bed203d4ebc04922d3090a Mon Sep 17 00:00:00 2001 From: Zhao Lei Date: Wed, 25 May 2016 16:01:03 +0800 Subject: [PATCH 7/8] manual: update: Add kernelTCP configuration into code's --help To make --help option output same example with man. Signed-off-by: Zhao Lei --- update.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/update.go b/update.go index 815d6533..02b8a151 100644 --- a/update.go +++ b/update.go @@ -32,7 +32,8 @@ The accepted format is as follow (unchanged values can be omitted): "limit": 0, "reservation": 0, "swap": 0, - "kernel": 0 + "kernel": 0, + "kernelTCP": 0 }, "cpu": { "shares": 0, From 34d100f970dbdab6e02ef60f663ddbc18343568b Mon Sep 17 00:00:00 2001 From: Zhao Lei Date: Tue, 24 May 2016 18:52:29 +0800 Subject: [PATCH 8/8] manual: add manual for ps command This patch add manual for ps command, and remove remove example for --format command, which is not necessary. Suggested-by: Aleksa Sarai Signed-off-by: Zhao Lei --- man/runc-ps.8.md | 13 +++++++++++++ ps.go | 7 +------ 2 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 man/runc-ps.8.md diff --git a/man/runc-ps.8.md b/man/runc-ps.8.md new file mode 100644 index 00000000..abfca412 --- /dev/null +++ b/man/runc-ps.8.md @@ -0,0 +1,13 @@ +# NAME + runc ps - ps displays the processes running inside a container + +# SYNOPSIS + runc ps [command options] + +# OPTIONS + --format, -f select one of: table(default) or json + +The default format is table. The following will output the processes of a container +in json format: + + # runc ps -f json diff --git a/ps.go b/ps.go index 9b10af0c..0b6ed167 100644 --- a/ps.go +++ b/ps.go @@ -21,12 +21,7 @@ var psCommand = cli.Command{ cli.StringFlag{ Name: "format, f", Value: "", - Usage: `select one of: ` + formatOptions + `. - -The default format is table. The following will output the processes of a container -in json format: - - # runc ps -f json`, + Usage: `select one of: ` + formatOptions, }, }, Action: func(context *cli.Context) error {