RESOLVED FIXED Bug 209223
[Flatpak SDK] Release logs not sent to journald when running within the SDK runtime
https://bugs.webkit.org/show_bug.cgi?id=209223
Summary [Flatpak SDK] Release logs not sent to journald when running within the SDK r...
Philippe Normand
Reported 2020-03-18 05:52:08 PDT
This needs further investigation.
Attachments
Patch (2.55 KB, patch)
2020-03-18 09:08 PDT, Philippe Normand
no flags
Patch (2.58 KB, patch)
2020-03-18 09:24 PDT, Philippe Normand
no flags
Patch (2.54 KB, patch)
2020-03-19 02:56 PDT, Philippe Normand
no flags
Patch (2.65 KB, patch)
2020-03-19 03:55 PDT, Philippe Normand
no flags
Patch (2.78 KB, patch)
2020-03-19 07:57 PDT, Philippe Normand
clopez: review+
Philippe Normand
Comment 1 2020-03-18 08:43:47 PDT
$ cat ~/journal-test.c #include <systemd/sd-journal.h> int main(int argc, char *argv[]) { sd_journal_print(LOG_NOTICE, "Hello World"); return 0; } $ gcc -o /tmp/test `pkg-config --cflags --libs libsystemd` /app/phil/journal-test.c $ strace /tmp/test [...] sendmsg(3, {msg_name={sa_family=AF_UNIX, sun_path="/run/systemd/journal/socket"}, msg_namelen=30, msg_iov=[{iov_base="MESSAGE=Hello World", iov_len=19}, {iov_base="\n", iov_len=1}, {iov_base="PRIORITY=5", iov_len=10}, {iov_base="\n", iov_len=1}, {iov_base="CODE_FILE=/app/phil/journal-test"..., iov_len=34}, {iov_base="\n", iov_len=1}, {iov_base="CODE_LINE=5", iov_len=11}, {iov_base="\n", iov_len=1}, {iov_base="CODE_FUNC=main", iov_len=14}, {iov_base="\n", iov_len=1}, {iov_base="SYSLOG_IDENTIFIER=", iov_len=18}, {iov_base="test", iov_len=4}, {iov_base="\n", iov_len=1}], msg_iovlen=13, msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = -1 ENOENT (No such file or directory)
Philippe Normand
Comment 2 2020-03-18 09:08:50 PDT
Philippe Normand
Comment 3 2020-03-18 09:24:42 PDT
Aakash Jain
Comment 4 2020-03-18 14:30:27 PDT
Comment on attachment 393870 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=393870&action=review > Tools/flatpak/flatpakutils.py:580 > + # systemd journal socket. So white-list everything in /run. ¯\_(ã)_/¯ Seems like unintentional characters here: ¯\_(ã)_/¯ breaks gtk api-tests. https://ews-build.webkit.org/#/builders/34/builds/5027/steps/10/logs/stdio
Patrick Griffis
Comment 5 2020-03-18 18:35:37 PDT
I think pulling in all of `/run` is quite scary when it comes to reproducability. I'd rather see specific paths but if the goal is to just get things working and tighten it down later maybe its fine.
Philippe Normand
Comment 6 2020-03-19 02:56:04 PDT
Philippe Normand
Comment 7 2020-03-19 03:02:31 PDT
(In reply to Patrick Griffis from comment #5) > I think pulling in all of `/run` is quite scary when it comes to > reproducability. I'd rather see specific paths but if the goal is to just > get things working and tighten it down later maybe its fine. Would you support adding a --socket=journal option to `flatpak build`?
Adrian Perez
Comment 8 2020-03-19 03:22:14 PDT
Comment on attachment 393959 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=393959&action=review > Tools/flatpak/flatpakutils.py:581 > + "--bind-mount=/run=/run", Wouldn't it be enough to bind-mount only /run/systemd/journal? I think that would be better than using the big hammer.
Philippe Normand
Comment 9 2020-03-19 03:55:03 PDT
Carlos Alberto Lopez Perez
Comment 10 2020-03-19 07:50:31 PDT
Comment on attachment 393962 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=393962&action=review > Tools/flatpak/flatpakutils.py:-579 > - # Workaround for https://webkit.org/b/187384 to have our own perl modules usable inside the sandbox > - # as setting the PERL5LIB envvar won't work inside apache (and for scripts using `perl -T``). > - "--bind-mount=/run/host/%s=%s" % (tempfile.gettempdir(), tempfile.gettempdir()), the crash log code assumes /run/host its there, if you delete this you have to adapt that. grep for /run/host on Tools > Tools/flatpak/flatpakutils.py:583 > + "--bind-mount=/run/systemd/journal=/run/systemd/journal", I wonder about ICECC support. Doesn't it need to access /run/icecc/iceccd.socket from the host?
Philippe Normand
Comment 11 2020-03-19 07:56:18 PDT
Comment on attachment 393962 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=393962&action=review >> Tools/flatpak/flatpakutils.py:-579 >> - "--bind-mount=/run/host/%s=%s" % (tempfile.gettempdir(), tempfile.gettempdir()), > > the crash log code assumes /run/host its there, if you delete this you have to adapt that. grep for /run/host on Tools Gotcha >> Tools/flatpak/flatpakutils.py:583 >> + "--bind-mount=/run/systemd/journal=/run/systemd/journal", > > I wonder about ICECC support. Doesn't it need to access /run/icecc/iceccd.socket from the host? Access to the socket is already granted, you can check in this method a few lines below :)
Philippe Normand
Comment 12 2020-03-19 07:57:26 PDT
Philippe Normand
Comment 13 2020-03-19 08:25:11 PDT
Note You need to log in before you can comment on or make changes to this bug.