Hello community, here is the log from the commit of package catatonit for openSUSE:Factory checked in at 2019-02-08 12:06:03 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/catatonit (Old) and /work/SRC/openSUSE:Factory/.catatonit.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "catatonit" Fri Feb 8 12:06:03 2019 rev:5 rq:670014 version:0.1.4 Changes: -------- --- /work/SRC/openSUSE:Factory/catatonit/catatonit.changes 2018-04-22 14:33:46.185712802 +0200 +++ /work/SRC/openSUSE:Factory/.catatonit.new.28833/catatonit.changes 2019-02-08 12:06:25.269626453 +0100 @@ -1,0 +2,5 @@ +Tue Jan 29 07:35:13 UTC 2019 - Aleksa Sarai <[email protected]> + +- Update to catatonit v0.1.4, which include support for "-g". + +------------------------------------------------------------------- Old: ---- catatonit-0.1.3.tar.xz catatonit-0.1.3.tar.xz.asc New: ---- catatonit-0.1.4.tar.xz catatonit-0.1.4.tar.xz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ catatonit.spec ++++++ --- /var/tmp/diff_new_pack.647PAg/_old 2019-02-08 12:06:26.901625840 +0100 +++ /var/tmp/diff_new_pack.647PAg/_new 2019-02-08 12:06:26.905625838 +0100 @@ -1,7 +1,7 @@ # # spec file for package catatonit # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,12 +12,12 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: catatonit -Version: 0.1.3 +Version: 0.1.4 Release: 0 Summary: A signal-forwarding process manager for containers License: GPL-3.0-or-later ++++++ _service ++++++ --- /var/tmp/diff_new_pack.647PAg/_old 2019-02-08 12:06:26.945625823 +0100 +++ /var/tmp/diff_new_pack.647PAg/_new 2019-02-08 12:06:26.945625823 +0100 @@ -2,14 +2,14 @@ <service name="download_url" mode="disabled"> <param name="protocol">https</param> <param name="host">github.com</param> - <param name="path">openSUSE/catatonit/releases/download/v0.1.3/catatonit.tar.xz</param> - <param name="filename">catatonit-0.1.3.tar.xz</param> + <param name="path">openSUSE/catatonit/releases/download/v0.1.4/catatonit.tar.xz</param> + <param name="filename">catatonit-0.1.4.tar.xz</param> </service> <service name="download_url" mode="disabled"> <param name="protocol">https</param> <param name="host">github.com</param> - <param name="path">openSUSE/catatonit/releases/download/v0.1.3/catatonit.tar.xz.asc</param> - <param name="filename">catatonit-0.1.3.tar.xz.asc</param> + <param name="path">openSUSE/catatonit/releases/download/v0.1.4/catatonit.tar.xz.asc</param> + <param name="filename">catatonit-0.1.4.tar.xz.asc</param> </service> <service name="set_version" mode="disabled"> <param name="basename">catatonit</param> ++++++ catatonit-0.1.3.tar.xz -> catatonit-0.1.4.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/catatonit-0.1.3/.travis.yml new/catatonit-0.1.4/.travis.yml --- old/catatonit-0.1.3/.travis.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/catatonit-0.1.4/.travis.yml 2019-01-29 08:28:39.000000000 +0100 @@ -0,0 +1,30 @@ +# catatonit: a container init so simple it's effectively brain-dead +# Copyright (C) 2018 SUSE LLC +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + +os: linux +language: c + +compiler: + - gcc + - clang + +notifications: + email: false + +script: + - autoreconf -fi && ./configure && make + - file ./catatonit | grep 'statically linked' +# TODO: Add tests. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/catatonit-0.1.3/README.md new/catatonit-0.1.4/README.md --- old/catatonit-0.1.3/README.md 2018-04-18 14:51:12.000000000 +0200 +++ new/catatonit-0.1.4/README.md 2019-01-29 08:28:39.000000000 +0100 @@ -1,5 +1,7 @@ ## catatonit ## +[](https://travis-ci.org/openSUSE/catatonit) + A container init that is so simple it's effectively brain-dead. This is a rewrite of [initrs][initrs] in C, because we found that it is not possible to statically compile Rust binaries without using musl. That was, in turn, a @@ -23,13 +25,31 @@ [initrs]: https://github.com/cyphar/initrs [signalfd-broken]: https://ldpreload.com/blog/signalfd-is-useless +### Usage ### + +catatonit has identical usage to other basic `docker-init`'s -- you give it the +command and list of arguments to that command. If catatonit is not pid1, it +will try to use the sub-reaper support in the kernel. You can pass `-g` if you +want signals to be forwarded to the entire process group of your spawned +process (otherwise it's just forwarded to the process spawned). + +### Installation ### + +catatonit uses autotools for building, so building is a fairly standard: + +``` +% ./configure +% make +% sudo make install +``` + ### License ### catatonit is licensed under the GNU General Public License version 3 or later. ``` catatonit: a container init so simple it's effectively brain-dead -Copyright (C) 2018 SUSE LLC +Copyright (C) 2018-2019 SUSE LLC This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/catatonit-0.1.3/catatonit.c new/catatonit-0.1.4/catatonit.c --- old/catatonit-0.1.3/catatonit.c 2018-04-18 14:51:12.000000000 +0200 +++ new/catatonit-0.1.4/catatonit.c 2019-01-29 08:28:39.000000000 +0100 @@ -83,7 +83,7 @@ static void usage(void) { - fprintf(stderr, "usage: %s [-hLV] [--] <progname> [<arguments>...]\n", PROGRAM_NAME); + fprintf(stderr, "usage: %s [-ghLV] [--] <progname> [<arguments>...]\n", PROGRAM_NAME); } static void help(void) @@ -91,6 +91,7 @@ usage(); fprintf(stderr, "\n"); fprintf(stderr, "options:\n"); + 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, " -V, --version Print version information.\n"); @@ -279,21 +280,25 @@ * first *pid1* argv argument rather than our own. */ int opt; + bool kill_pgid = false; const struct option longopts[] = { {name: "version", has_arg: no_argument, flag: NULL, val: 'V'}, {}, }; - while ((opt = getopt_long(argc, argv, "hLV", longopts, NULL)) != -1) { + while ((opt = getopt_long(argc, argv, "ghLV", longopts, NULL)) != -1) { switch (opt) { + case 'g': + kill_pgid = true; + break; + case 'h': + help(); + exit(0); case 'L': license(); exit(0); case 'V': version(); exit(0); - case 'h': - help(); - exit(0); default: usage(); exit(1); @@ -331,6 +336,12 @@ debug("pid1 (%d) spawned: %s", pid1, argv[0]); /* + * 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; + + /* * Wait for signals and process them as necessary. At this point we are no * longer allowed to bail(), because if anything breaks it's ultimately our * fault since a pid1 death will kill the container. @@ -397,8 +408,8 @@ /* 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, ssi.ssi_signo) < 0) - warn("forwarding of signal %d to pid1 (%d) failed: %m", ssi.ssi_signo, pid1); + 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.3/configure.ac new/catatonit-0.1.4/configure.ac --- old/catatonit-0.1.3/configure.ac 2018-04-18 14:51:12.000000000 +0200 +++ new/catatonit-0.1.4/configure.ac 2019-01-29 08:28:39.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.3], [https://bugs.opensuse.org/], [], [https://github.com/openSUSE/catatonit/]) +AC_INIT([catatonit], [0.1.4], [https://bugs.opensuse.org/], [], [https://github.com/openSUSE/catatonit/]) AM_INIT_AUTOMAKE([-Wall foreign]) LT_PREREQ([2.4.2]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/catatonit-0.1.3/hack/release.sh new/catatonit-0.1.4/hack/release.sh --- old/catatonit-0.1.3/hack/release.sh 2018-04-18 14:51:12.000000000 +0200 +++ new/catatonit-0.1.4/hack/release.sh 2019-01-29 08:28:39.000000000 +0100 @@ -20,14 +20,13 @@ # touch anything else in this script in order to use this elsewhere. project="catatonit" root="$(readlink -f "$(dirname "${BASH_SOURCE}")/..")" -( cd "$root" ; autoreconf -fi ; ./configure ) # This function takes an output path as an argument, where the built # (preferably static) binary should be placed. function build_project() { builddir="$(dirname "$1")" - ( cd "$root" ; make ) + ( cd "$root" ; autoreconf -fi ; ./configure; make ) strip "./$project" mv "./$project" "$1" }
