fputs(_(" -f, --fork fork before launching <program>\n"), out);
fputs(_(" --kill-child[=<signame>] when dying, kill the forked child (implies --fork)\n"
" defaults to SIGKILL\n"), out);
+ fputs(_(" --forward-signals forward SIGTERM and SIGINT to child (implies --fork)\n"), out);
fputs(USAGE_SEPARATOR, out);
fputs(_(" --setgroups allow|deny control the setgroups syscall in user namespaces\n"), out);
fputs(_(" --keep-caps retain capabilities granted in user namespaces\n"), out);
OPT_MAPAUTO,
OPT_MAPSUBIDS,
OPT_OWNER,
+ OPT_FORWARD_SIGNALS,
};
static const struct option longopts[] = {
{ "help", no_argument, NULL, 'h' },
{ "fork", no_argument, NULL, 'f' },
{ "kill-child", optional_argument, NULL, OPT_KILLCHILD },
+ { "forward-signals", no_argument, NULL, OPT_FORWARD_SIGNALS },
{ "mount-proc", optional_argument, NULL, OPT_MOUNTPROC },
{ "mount-binfmt", optional_argument, NULL, OPT_MOUNTBINFMT },
{ "map-user", required_argument, NULL, OPT_MAPUSER },
int setgrpcmd = SETGROUPS_NONE;
int unshare_flags = 0;
- int c, forkit = 0;
+ int c, forkit = 0, forward_signals = 0;
uid_t mapuser = -1, owneruser = -1;
gid_t mapgroup = -1, ownergroup = -1;
struct map_range *usermap = NULL;
keepcaps = 1;
cap_last_cap(); /* Force last cap to be cached before we fork. */
break;
+ case OPT_FORWARD_SIGNALS:
+ forkit = 1;
+ forward_signals = 1;
+ break;
case 'S':
uid = strtoul_or_err(optarg, _("failed to parse uid"));
force_uid = 1;