Commit 25ef4199 authored by Pavel Emelyanov's avatar Pavel Emelyanov

tty: More descriptive log message about --shell-job requirement

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent f16d7c64
......@@ -27,6 +27,7 @@
#include "net.h"
#include "version.h"
#include "page-xfer.h"
#include "tty.h"
struct cr_options opts;
......@@ -105,7 +106,7 @@ int main(int argc, char *argv[])
{ "veth-pair", required_argument, 0, 47},
{ "action-script", required_argument, 0, 49},
{ LREMAP_PARAM, no_argument, 0, 41},
{ "shell-job", no_argument, 0, 'j'},
{ OPT_SHELL_JOB, no_argument, 0, 'j'},
{ "file-locks", no_argument, 0, 'l'},
{ "page-server", no_argument, 0, 50},
{ "address", required_argument, 0, 51},
......@@ -361,7 +362,7 @@ usage:
pr_msg(" The environment variable CRTOOL_SCRIPT_ACTION contains one of the actions:\n");
pr_msg(" * network-lock - lock network in a target network namespace\n");
pr_msg(" * network-unlock - unlock network in a target network namespace\n");
pr_msg(" -j|--shell-job allow to dump and restore shell jobs\n");
pr_msg(" -j|--%s allow to dump and restore shell jobs\n", OPT_SHELL_JOB);
pr_msg(" -l|--file-locks handle file locks, for safety, only used for container\n");
pr_msg("\n* Logging:\n");
......
......@@ -24,4 +24,6 @@ extern int tty_verify_active_pairs(void);
extern int tty_prep_fds(struct cr_options *opts);
extern void tty_fini_fds(void);
#define OPT_SHELL_JOB "shell-job"
#endif /* __CR_TTY_H__ */
......@@ -8,7 +8,7 @@
#include "lock.h"
#include "namespaces.h"
#include "files.h"
#include "tty.h"
#include "asm/dump.h"
#include "protobuf.h"
......@@ -99,8 +99,8 @@ int dump_pstree(struct pstree_item *root_item)
*/
if (root_item->pid.virt != root_item->sid) {
if (!opts.shell_job) {
pr_err("The root process %d is not a session leader,"
"miss option?\n", item->pid.virt);
pr_err("The root process %d is not a session leader. "
"Consider using --" OPT_SHELL_JOB " option\n", item->pid.virt);
return -1;
}
}
......
......@@ -1015,8 +1015,8 @@ int dump_verify_tty_sids(void)
if (!item || item->pid.virt != dinfo->sid) {
if (!opts.shell_job) {
pr_err("Found sid %d pgid %d (%s) on peer fd %d. "
"Missing option?\n",
pr_err("Found dangling tty with sid %d pgid %d (%s) on peer fd %d. "
"Consider using --" OPT_SHELL_JOB " option.\n",
dinfo->sid, dinfo->pgrp,
tty_type(dinfo->major),
dinfo->fd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment