Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package catatonit for openSUSE:Factory checked in at 2022-04-13 21:04:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/catatonit (Old) and /work/SRC/openSUSE:Factory/.catatonit.new.1900 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "catatonit" Wed Apr 13 21:04:09 2022 rev:10 rq:969193 version:0.1.7 Changes: -------- --- /work/SRC/openSUSE:Factory/catatonit/catatonit.changes 2021-12-02 22:30:38.706577422 +0100 +++ /work/SRC/openSUSE:Factory/.catatonit.new.1900/catatonit.changes 2022-04-13 21:04:24.084538155 +0200 @@ -1,0 +2,8 @@ +Mon Apr 11 09:57:33 UTC 2022 - Richard Brown <rbr...@suse.com> + +- Update to catatont v0.1.7 +- This release adds the ability for catatonit to be used as the only +process in a pause container, by passing the -P flag (in this mode no +subprocess is spawned and thus no signal forwarding is done). + +------------------------------------------------------------------- Old: ---- catatonit-0.1.6.tar.xz catatonit-0.1.6.tar.xz.asc New: ---- catatonit-0.1.7.tar.xz catatonit-0.1.7.tar.xz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ catatonit.spec ++++++ --- /var/tmp/diff_new_pack.x4m0tV/_old 2022-04-13 21:04:27.764541097 +0200 +++ /var/tmp/diff_new_pack.x4m0tV/_new 2022-04-13 21:04:27.772541104 +0200 @@ -1,7 +1,7 @@ # # spec file for package catatonit # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: catatonit -Version: 0.1.6 +Version: 0.1.7 Release: 0 Summary: A signal-forwarding process manager for containers License: GPL-3.0-or-later ++++++ catatonit-0.1.6.tar.xz -> catatonit-0.1.7.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/catatonit-0.1.6/README.md new/catatonit-0.1.7/README.md --- old/catatonit-0.1.6/README.md 2021-09-16 03:47:50.000000000 +0200 +++ new/catatonit-0.1.7/README.md 2021-11-01 06:01:47.000000000 +0100 @@ -19,8 +19,8 @@ would be closer to full rewrites. In addition, the purpose of `catatonit` is to only support the key usage by -`docker-init` which is `/dev/init -- <your program>`. No other features will be -added. +`docker-init` which is `/dev/init -- <your program>`. With few exceptions, no +other features will be added. [initrs]: https://github.com/cyphar/initrs [signalfd-broken]: https://ldpreload.com/blog/signalfd-is-useless @@ -33,6 +33,9 @@ want signals to be forwarded to the entire process group of your spawned process (otherwise it's just forwarded to the process spawned). +If you wish to use catatonit as a convenient pause container (do not spawn a +child process nor do any signal handling), use pass `-P`. + ### Installation ### catatonit uses autotools for building, so building is a fairly standard: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/catatonit-0.1.6/catatonit.c new/catatonit-0.1.7/catatonit.c --- old/catatonit-0.1.6/catatonit.c 2021-09-16 03:47:50.000000000 +0200 +++ new/catatonit-0.1.7/catatonit.c 2021-11-01 06:01:47.000000000 +0100 @@ -92,7 +92,7 @@ static void usage(void) { - fprintf(stderr, "usage: %s [-ghLV] [--] <progname> [<arguments>...]\n", PROGRAM_NAME); + fprintf(stderr, "usage: %s [-ghLPV] [--] <progname> [<arguments>...]\n", PROGRAM_NAME); } static void help(void) @@ -103,6 +103,7 @@ fprintf(stderr, " -g Forward signals to pid1's process group.\n"); fprintf(stderr, " -h Print this help page.\n"); fprintf(stderr, " -L Print license information.\n"); + fprintf(stderr, " -P Run in pause mode (no program is run and quit on SIGINT).\n"); fprintf(stderr, " -V, --version Print version information.\n"); fprintf(stderr, "\n"); fprintf(stderr, "The source code can be found at <%s>.\n", PROGRAM_URL); @@ -448,15 +449,19 @@ */ int opt; bool kill_pgid = false; + bool run_as_pause = false; const struct option longopts[] = { {name: "version", has_arg: no_argument, flag: NULL, val: 'V'}, {}, }; - while ((opt = getopt_long(argc, argv, "ghLV", longopts, NULL)) != -1) { + while ((opt = getopt_long(argc, argv, "ghLPV", longopts, NULL)) != -1) { switch (opt) { case 'g': kill_pgid = true; break; + case 'P': + run_as_pause = true; + break; case 'h': help(); exit(0); @@ -473,7 +478,7 @@ } argv += optind; argc -= optind; - if (argc < 1) + if (argc < 1 && !run_as_pause) bail_usage("missing program name"); /* @@ -493,14 +498,18 @@ } /* Spawn the faux-pid1. */ - pid_t pid1 = spawn_pid1(argv[0], argv, &pid1_sigmask); - if (pid1 <= 0) - bail("failed to spawn pid1: %m"); - - /* One final check to make sure that it actually spawned. */ - if (kill(pid1, 0) < 0) - bail("self-check that pid1 (%d) was spawned failed: %m", pid1); - debug("pid1 (%d) spawned: %s", pid1, argv[0]); + pid_t pid1 = 0; + + if (!run_as_pause) { + pid1 = spawn_pid1(argv[0], argv, &pid1_sigmask); + if (pid1 <= 0) + bail("failed to spawn pid1: %m"); + + /* One final check to make sure that it actually spawned. */ + if (kill(pid1, 0) < 0) + bail("self-check that pid1 (%d) was spawned failed: %m", pid1); + debug("pid1 (%d) spawned: %s", pid1, argv[0]); + } if (close_fds_ge_than(3, sfd) < 0) warn("failed to close some file descriptor in range >=3"); @@ -509,7 +518,7 @@ * The "pid" we send signals to. With -g we send signals to the entire * process group which pid1 is in, which is represented by a -ve pid. */ - pid_t pid1_target = kill_pgid ? -pid1 : pid1; + pid_t pid1_target = run_as_pause ? 0 : (kill_pgid ? -pid1 : pid1); /* * Wait for signals and process them as necessary. At this point we are no @@ -559,8 +568,12 @@ /* A signal sent to us by a user which we must forward to pid1. */ default: /* We just forward the signal to pid1. */ - if (kill(pid1_target, ssi.ssi_signo) < 0) + if (run_as_pause) { + if (ssi.ssi_signo == SIGTERM || ssi.ssi_signo == SIGINT) + return 0; + } else if (kill(pid1_target, ssi.ssi_signo) < 0) { warn("forwarding of signal %d to pid1 (%d) failed: %m", ssi.ssi_signo, pid1_target); + } break; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/catatonit-0.1.6/configure.ac new/catatonit-0.1.7/configure.ac --- old/catatonit-0.1.6/configure.ac 2021-09-16 03:47:50.000000000 +0200 +++ new/catatonit-0.1.7/configure.ac 2021-11-01 06:01:47.000000000 +0100 @@ -15,7 +15,7 @@ # along with this program. If not, see <https://www.gnu.org/licenses/>. AC_PREREQ([2.69]) -AC_INIT([catatonit], [0.1.6], [https://bugs.opensuse.org/], [], [https://github.com/openSUSE/catatonit/]) +AC_INIT([catatonit], [0.1.7], [https://bugs.opensuse.org/], [], [https://github.com/openSUSE/catatonit/]) AM_INIT_AUTOMAKE([-Wall foreign]) LT_PREREQ([2.4.2])