From 7b17a7d72f5ba5ad838b19803534c56a46f3bce9 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 28 Sep 2012 00:46:32 +0200 Subject: journal: add minimal journal gateway daemon based on GNU libmicrohttpd This minimal HTTP server can serve journal data via HTTP. Its primary purpose is synchronization of journal data across the network. It serves journal data in three formats: text/plain: the text format known from /var/log/messages application/json: the journal entries formatted as JSON application/vnd.fdo.journal: the binary export format of the journal The HTTP server also serves a small HTML5 app that makes use of the JSON serialization to present the journal data to the user. Examples: This downloads the journal in text format: # systemctl start systemd-journal-gatewayd.service # wget http://localhost:19531/entries Same for JSON: # curl -H"Accept: application/json" http://localhost:19531/entries Access via web browser: $ firefox http://localhost:19531/ --- units/.gitignore | 1 + units/systemd-journal-gatewayd.service.in | 16 ++++++++++++++++ units/systemd-journal-gatewayd.socket | 15 +++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 units/systemd-journal-gatewayd.service.in create mode 100644 units/systemd-journal-gatewayd.socket (limited to 'units') diff --git a/units/.gitignore b/units/.gitignore index 74bff5431f..c72e2cbee3 100644 --- a/units/.gitignore +++ b/units/.gitignore @@ -1,3 +1,4 @@ +/systemd-journal-gatewayd.service /systemd-journal-flush.service /systemd-hibernate.service /systemd-suspend.service diff --git a/units/systemd-journal-gatewayd.service.in b/units/systemd-journal-gatewayd.service.in new file mode 100644 index 0000000000..c3b5c725bf --- /dev/null +++ b/units/systemd-journal-gatewayd.service.in @@ -0,0 +1,16 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Journal Gateway Service +Requires=systemd-journal-gatewayd.socket + +[Service] +ExecStart=@rootlibexecdir@/systemd-journal-gatewayd + +[Install] +Also=systemd-journal-gatewayd.socket diff --git a/units/systemd-journal-gatewayd.socket b/units/systemd-journal-gatewayd.socket new file mode 100644 index 0000000000..fd11058ab4 --- /dev/null +++ b/units/systemd-journal-gatewayd.socket @@ -0,0 +1,15 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Journal Gateway Service Socket + +[Socket] +ListenStream=19531 + +[Install] +WantedBy=sockets.target -- cgit v1.2.3-54-g00ecf