These are chat archives for resin-io/chat

29th
Jan 2016
Craig Mulligan
@craig-mulligan
Jan 29 2016 12:33
So Docker only passes the signal to the process run in the entry point. Its that process responsibility to hand off signals from there. But that doesn't explain why running the script in the entry point ['bash', 'start.sh'] is still not getting the signals. Perhaps systemd issues I'll experiment a little tonight.
Pablo Carranza Vélez
@pcarranzav
Jan 29 2016 12:36
ah, but are you using CMD or ENTRYPOINT?
Craig Mulligan
@craig-mulligan
Jan 29 2016 12:37
CMD? I thought they were interchangeable?
Pablo Carranza Vélez
@pcarranzav
Jan 29 2016 12:38
they are slightly different
and our images have an entrypoint
so probably you'd need to overwrite it with a custom one that has the trap
Craig Mulligan
@craig-mulligan
Jan 29 2016 12:41
Is overwriting as easy as just running ENTRYPOINT instead of CMD?
Pablo Carranza Vélez
@pcarranzav
Jan 29 2016 12:44
yeah
but if you're using systemd, you'll disable it
you'd also have to add all of this stuff to your script: https://github.com/resin-io-library/base-images/blob/master/systemd/entry.sh
Craig Mulligan
@craig-mulligan
Jan 29 2016 12:47
yea that makes sense. Let me give it try, thanks!
Pablo Carranza Vélez
@pcarranzav
Jan 29 2016 12:49
anytime! :+1:
Craig Mulligan
@craig-mulligan
Jan 29 2016 13:04
Rad that worked! So definitely passes signals pid 1
Pablo Carranza Vélez
@pcarranzav
Jan 29 2016 13:06
nice!
Craig Mulligan
@craig-mulligan
Jan 29 2016 13:06
hmm is it not a good idea for the systemd entry script to trap signals a clean up before the container closes? It loads the device files surely it should unmount them on sigterm then?
Pablo Carranza Vélez
@pcarranzav
Jan 29 2016 13:07
hmm makes sense...
also, systemd reacts weird to sigterm
so maybe we should send it a different signal from the trap?
looks like a job for @nghiant2710 :)
Craig Mulligan
@craig-mulligan
Jan 29 2016 13:11
Weirdly in what sense? @nghiant2710 are we doing anything to kill containers gracefully?
Pablo Carranza Vélez
@pcarranzav
Jan 29 2016 13:14
vague memory, let me google
Upon receiving this signal the systemd system manager serializes its state, reexecutes itself and deserializes the saved state again. This is mostly equivalent to systemctl daemon-reexec.

systemd user managers will start the exit.target unit when this signal is received. This is mostly equivalent to systemctl --user start exit.target.
http://www.freedesktop.org/software/systemd/man/systemd.html
Craig Mulligan
@craig-mulligan
Jan 29 2016 13:54
Wtf? it re-executes?
daemon-reexec - "This command is of little use except for debugging and package upgrades"