From 22a6afbe89d24664f1ce1de9305e3efd8053236f Mon Sep 17 00:00:00 2001 From: Bruno Bottazzini Date: Wed, 4 Nov 2015 17:05:20 -0200 Subject: [PATCH] Replace time journald message for a fixed tail If the clock of the device is with a wrong data, systemd will not send the output of 15 minutes ago. journalctl will return that the timestamp is invalid. Since this patch replaces the use of the time by a fixed number this problem will not occur anymore. Signed-off-by: Bruno Bottazzini --- scripts/journalctl-unit.sh | 2 +- server/routes.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/journalctl-unit.sh b/scripts/journalctl-unit.sh index 0e00654..2b3d436 100755 --- a/scripts/journalctl-unit.sh +++ b/scripts/journalctl-unit.sh @@ -31,4 +31,4 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SYSTEMD_UNIT="fbp-runner@$(systemd-escape $1).service" -journalctl -o json-pretty --since="15 min ago" --no-pager -u "$SYSTEMD_UNIT" +journalctl -o json-pretty -n 100 --no-pager -u "$SYSTEMD_UNIT" diff --git a/server/routes.js b/server/routes.js index c83dc5e..501dc87 100644 --- a/server/routes.js +++ b/server/routes.js @@ -139,7 +139,7 @@ var child; if (!unit_name) { child = spawn('journalctl', - ['-o', 'json-pretty', '--since=15 min ago', '--no-pager']); + ['-o', 'json-pretty', '-n', '100', '--no-pager']); child.on('error', function(err) { error = true;