From e540ab40c0efe6360e9a6e3d9f34b0e1b420fdde Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Wed, 20 Feb 2019 20:21:08 -0800 Subject: codex: initial commit !!! This code is a very quick hack I made in an evening of !!! inspired curiosity, the code should be considered of junk !!! quality. Codex aspires to be a read-only FUSE interface to the journal provided by systemd. At this point it only implements simple reading of the journal through a single match filter selected via filesystem path. With codex mounting the journal @ /mnt, you can see what fields are available for matching against via: `ls /mnt/by-field` This returns a list of fields as directories, which you can then list the contents of to see all the unique values present for the repsective field, returned as regular files: `ls /mnt/by-field/UNIT` Then by reading one of the returned files, you read the contents of the journal filtered on the respective field and value, e.g.: `cat /mnt/by-field/UNIT/apt-daily.timer` and you'll get a stream of all the data in the journal with a filter of UNIT=apt-daily.timer With some work, this could be made more advanced supporting combined filters, perhaps in the form of: `cat /mnt/by-field/UNIT/apt-daily.timer/and/by-field/PRIORITY/3/all` As-is, the path by-field/UNIT/apt-daily.timer is a regular file, so no such constructions are possible. But if it were changed to be another directory, where you can select further matches by traversing yet another and/by-field subpath, where all the fields are available (or maybe only the matching subset of fields if feasible), then more complex uses could be satisfied. Imagine or/by-field and and/by-field being available under every value's directory. Note this commit includes a barely functioning PoC. It is not intended for production, but you can already use it to navigate journals in a way I find more pleasant than journalctl. I think it'd be great to have a tool like this built out with all the bells and whistles. It may make sense to roll something similar into journalctl like `journalctl --mount /mnt/point`. --- configure.ac | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 configure.ac (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..cda2be8 --- /dev/null +++ b/configure.ac @@ -0,0 +1,26 @@ +AC_INIT([codex], [1.0], [vcaputo@pengaru.com]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +AC_PROG_CC +AM_PROG_CC_C_O +AM_PROG_AR +AC_PROG_RANLIB +AM_SILENT_RULES([yes]) + +CFLAGS="$CFLAGS -Wall" + +dnl Check for fuse +PKG_CHECK_MODULES(FUSE, fuse) +CFLAGS="$CFLAGS $FUSE_CFLAGS" +LIBS="$LIBS $FUSE_LIBS" + +dnl Check for libsystemd +PKG_CHECK_MODULES(SD, libsystemd) +CFLAGS="$CFLAGS $SD_CFLAGS" +LIBS="$LIBS $SD_LIBS" + +AC_CONFIG_FILES([ + Makefile + src/Makefile +]) + +AC_OUTPUT -- cgit v1.2.3