Commit Graph

204 Commits

Author SHA1 Message Date
Thomas Orozco 1a8dc6e21c Cleanup internal tests a little bit
No functional changes here.
2015-10-31 15:31:57 +01:00
Thomas Orozco a0b3006d48 Local tests: add `-it` to make them interruptible 2015-10-31 15:31:57 +01:00
Thomas Orozco a0bf435d2f Test that Tini restores signal configuration
Tini ignores certain signals, and blocks others, but in both cases
we restore them before executing the child process.

Add tests to ensure that we actually do that!
2015-10-31 15:31:57 +01:00
Thomas Orozco e3ae587f92 Add a tty test for signal handling 2015-10-31 15:31:57 +01:00
Thomas Orozco 1ee5e650a3 Clarify that log messages are coming from Tini
Since we're ignoring SIGTTOU (for good reason), our log messages
could show in another program's output. To make the life of users
easier, let's clarify that the messages are owned by Tini.
2015-10-31 15:31:57 +01:00
Thomas Orozco 88342efc3c Ensure Tini doesn't lock up on of tty ownership
In the rare scenario where Tini is not running as PID 1 and its
child (or something else) sets TOSTOP on the tty, then Tini would
hang when if it tries to write debug messages. This commit fixes
this problem by ignoring SIGTTOU.

In the also rare scenario where two Tini instances are running, the
tty-passing could end up being done improperly (if the parent Tini
instance passes the tty to the child before the grandparent Tini
instance passes it to the parent Tini instance), and result in the
parent Tini instance running in the foreground. This commit fixes
this problem by passing the tty in the child (which we can do
because we are ignoring SIGTTOU).
2015-10-31 15:31:57 +01:00
Thomas Orozco 82acbc5ccc Make child process group foreground on active tty
When a tty is available, make the child process group foreground on
(and graciously fallback if no tty is available).

Fix #19
2015-10-31 15:31:57 +01:00
Thomas Orozco 40d313000c Add tests for passing tty to child process group 2015-10-31 15:31:57 +01:00
Thomas Orozco 364e4b9f02 Merge pull request #20 from krallin/alpine-package
Include install instructions for Alpine Linux
2015-10-28 20:24:05 +01:00
Thomas Orozco 158def8e93 Include install instructions for Alpine Linux
Fix: #18
2015-10-28 20:20:07 +01:00
Thomas Orozco cc6b2f9ca4 Merge pull request #17 from krallin/release-v0.8.0
Release v0.8.0
2015-10-27 20:08:45 +01:00
Thomas Orozco 197a39d9f2 Release 0.8.0 2015-10-27 20:05:50 +01:00
Thomas Orozco d4832f47ed Use unsigned ints for configuration
Let's avoid signed integer overflow if someone ends up passing
the same CLI argument thousands and thousands of times.
2015-10-27 19:54:15 +01:00
Thomas Orozco cf1cb5c4f6 Merge pull request #16 from krallin/dpw-kill-process-group
Support for kill process group, thanks @dpw!
2015-10-27 19:51:23 +01:00
Thomas Orozco e7bae983c6 Add tests for process group support 2015-10-26 21:52:06 +01:00
David Wragg 109019f917 Support for killing the whole child process group
tini only kills the immediate child process.  This means that if you
do, for example,

    docker run krallin/ubuntu-tini sh -c 'sleep 10'

and ctrl-C it, nothing happens: SIGINT is sent to the 'sh' process,
but that shell won't react to it while it is waiting for the 'sleep'
to finish.

This change adds a -g option to put the child process of tini into a
new process group, and sends signals to that group, so that every
process in the group gets a signal.  This corresponds more closely to
what happens when you do ctrl-C etc. in a terminal: The signal is sent
to the foreground process group.

So if you try the example above with a container image that passes -g
to tini, the SIGINT will be received by the 'sleep', and the container
promptly exits.
2015-10-26 21:52:06 +01:00
Thomas Orozco 1bfde9c126 Merge pull request #14 from krallin/release-0.7.0
Bump version to 0.7.0
2015-10-16 15:42:41 -07:00
Thomas Orozco e4b6654130 Bump version to 0.7.0 2015-10-16 15:39:14 -07:00
Thomas Orozco f2e8ed2487 Merge pull request #13 from krallin/better-git-checks
Better git checks
2015-10-16 15:38:28 -07:00
Thomas Orozco 7a6105e44d Add a default for FORCE_SUBREAPER in ddist.sh
Usually, we want to have FORCE_SUBREAPER=1.
2015-10-16 15:24:22 -07:00
Thomas Orozco 405eea7941 More robust git version checking
- Check the exit code from git log to check if we have a version.
- Add a "-dirty" suffix if the repo is dirty when the build is made.
2015-10-16 15:23:10 -07:00
Thomas Orozco 9b8a8a5764 Bump version to 0.6.0 2015-09-06 15:52:25 +02:00
Thomas Orozco 672c86cd36 Add smoke test in ci build 2015-09-06 15:50:24 +02:00
Thomas Orozco a285acc616 Merge pull request #7 from krallin/child-subreaper
Add child subreaper support
2015-09-06 15:49:05 +02:00
Thomas Orozco bfa8e0bf03 Update README to mention child subreaping support 2015-09-06 15:38:57 +02:00
Thomas Orozco 5650d29790 Only mention child subreaping if it's available
Tini can be built without child subreaper support. The warning message
shouldn't suggest using it if it's not available
2015-09-06 15:37:05 +02:00
Thomas Orozco 4b3075a11d Add tests for subreaper-less Tini
If we're going to make subreaper support an option, we should ensure
that running without subreaper support also works.
2015-09-06 15:29:11 +02:00
Thomas Orozco fa1f3602a6 Update README (subreaping) 2015-09-01 21:43:02 +02:00
Thomas Orozco 98e4449b36 Add tests for subreaping (and subreaping failures) 2015-09-01 21:17:10 +02:00
Thomas Orozco e1b463cdf5 Allow subreaping to be controlled with an env var
This allows users to enable subreaping even if they aren't the ones
calling Tini.
2015-09-01 21:17:10 +02:00
Thomas Orozco 1dc66f81eb Accelerate local builds by caching psutil, prctl 2015-09-01 21:17:10 +02:00
Thomas Orozco 376d186b2e Set default verbosity level to 1
This means warnings always show warnings, which is the right thing to do
considering the 2 warnings we show are actually for important
information.
2015-09-01 21:17:10 +02:00
Thomas Orozco bcb8a4b870 Allow users to enable sub-reaping
This allows users that don't control PID 1 in their container to still
use Tini to reap zombies.
2015-09-01 21:17:10 +02:00
Thomas Orozco 98311caf52 Merge pull request #5 from krallin/tests-in-ci
Run some functional tests in ci/run_build.sh
2015-07-05 14:36:35 +02:00
Thomas Orozco 1a863f8366 Run some functional tests in ci/run_build.sh
Using the child subreaper mechanism, we can actually run
tests inside the CI environment without depending on Docker.

While this does not replace the existing tests, it allows
at least some functional coverage within CI.
2015-07-05 14:25:21 +02:00
Thomas Orozco 5ed5f227e9 Merge pull request #4 from krallin/tini-static-from-tianon
Tini static from @tianon
2015-06-26 22:08:41 +02:00
Thomas Orozco e9546e0e1a Bump version to 0.5.0
+ `tini-static` is back, thanks to @tianon!
2015-06-26 21:43:53 +02:00
Thomas Orozco 3577da19cf Adjust tests to support tini-static
Valgrind does like statically-linked binaries due to false positives
coming from libc, which are ignord only if Valgrind can tell they're in
libc (which isn't the case when using static linking).
2015-06-26 21:43:53 +02:00
Tianon Gravi f2229f937e Bring back tini-static! 🎉
This allows the use of `tini` within even more minimal environments (such as images that are `FROM scratch` with a single application binary `COPY`'d in).
2015-06-26 21:43:53 +02:00
Thomas Orozco 1656d47301 Reuse CMAKE_PROJECT_NAME variable 2015-06-26 21:16:56 +02:00
Thomas Orozco f6f26afc2a Bump version to 0.4.3
+ More packaging changes to facilitate building packages in tini-images
2015-05-05 22:04:50 +02:00
Thomas Orozco f9dd36c1c0 Don't fail build if logging contents fails 2015-05-05 22:02:19 +02:00
Thomas Orozco 73aabc2a40 Bump version to 0.4.2
+ Only packaging changes
2015-05-05 21:24:44 +02:00
Thomas Orozco 363f480520 Merge pull request #2 from krallin/build-debug-rebased
Fix `rpmbuild` stub for Travis
2015-05-05 21:23:35 +02:00
Thomas Orozco 22e58b4c59 Log contents of packages for visual audit 2015-05-05 21:21:39 +02:00
Thomas Orozco 75f674edb1 Use absolute path to load stub rpmbuild
On Travis, Cmake does not run from the same directory as in our local
build environment. We need to ensure that PATH contains absolute paths
so that Cmake can find our stub rpmbuild.
2015-05-05 21:14:56 +02:00
Thomas Orozco 3764a7f224 Bump to 0.4.1
+ Add support for older Cmake to build on Ubuntu Precise (which is what
we have in Travis)
2015-05-04 22:30:10 +02:00
Thomas Orozco 12749881e0 Workaround to ensure compatibility with older CMake
Travis uses Ubuntu Precise, which has CMake 3.8. That version does not
have support for excluding /usr and /usr/bin from the %files% list
(which results in a package that conflicts with the filesystem package
and fails to install).

This commit:

+ Builds on Precise instead of Trusty
+ Adds install tests
2015-05-04 22:24:01 +02:00
Thomas Orozco b7afb24a82 Add notes about autogenerated files 2015-05-04 21:05:21 +02:00
Thomas Orozco 434dd956bd Bump version to 0.4.0
New features:

+ Generate DEB and RPM packages
2015-05-04 21:02:27 +02:00