diff options
author | B. Watson <urchlay@slackware.uk> | 2023-04-27 22:35:34 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-04-29 18:11:37 +0700 |
commit | 896ce0639a476158141a5f1f7d72a62e54432259 (patch) | |
tree | af039bce6b57a2c03978ba590a1352a3bee60c3b /system/loggedfs | |
parent | d3a015d4c6d7f8d52e6dea676ed419903988a283 (diff) |
system/loggedfs: Added (filesystem monitoring with FUSE)
Signed-off-by: bedlam <dave@slackbuilds.org>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/loggedfs')
-rw-r--r-- | system/loggedfs/README | 21 | ||||
-rw-r--r-- | system/loggedfs/doinst.sh | 11 | ||||
-rw-r--r-- | system/loggedfs/loggedfs.SlackBuild | 87 | ||||
-rw-r--r-- | system/loggedfs/loggedfs.info | 10 | ||||
-rw-r--r-- | system/loggedfs/manpage_grammar.diff | 29 | ||||
-rw-r--r-- | system/loggedfs/slack-desc | 19 |
6 files changed, 177 insertions, 0 deletions
diff --git a/system/loggedfs/README b/system/loggedfs/README new file mode 100644 index 000000000000..90617bc62f01 --- /dev/null +++ b/system/loggedfs/README @@ -0,0 +1,21 @@ +loggedfs (filesystem monitoring with FUSE) + +LoggedFS is a fuse-based filesystem which can log every operation that +happens in it. LoggedFS only sends a message to syslog (or a file) +when called by fuse and then lets the real filesystem do the rest of +the job. + +There is a sample config file installed as /etc/loggedfs.xml, for use +with the -c option. + +Note: loggedfs doesn't cross filesystem boundaries. If you e.g. have +/usr/local mounted as a separate partition, monitoring /usr won't +also monitor /usr/local (though you can always run another instance of +loggedfs in that case). + +Slackware note: since Slackware's /etc/mtab is a regular file (not +a symlink to /proc/mounts), killing a loggedfs process causes its +/etc/mtab entry to stay. This makes it look like the filesystem is +still mounted, though it actually isn't. To avoid this, always use +"fusermount -u" to cleanly umount the fs, which will also make the +loggedfs process exit. diff --git a/system/loggedfs/doinst.sh b/system/loggedfs/doinst.sh new file mode 100644 index 000000000000..d630c9b28a86 --- /dev/null +++ b/system/loggedfs/doinst.sh @@ -0,0 +1,11 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + rm $NEW + fi +} + +config etc/loggedfs.xml.new diff --git a/system/loggedfs/loggedfs.SlackBuild b/system/loggedfs/loggedfs.SlackBuild new file mode 100644 index 000000000000..3e7349dad1ce --- /dev/null +++ b/system/loggedfs/loggedfs.SlackBuild @@ -0,0 +1,87 @@ +#!/bin/bash + +# Slackware build script for loggedfs + +# Written by B. Watson (urchlay@slackware.uk) + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +# 20230423 bkw: this got removed 2 years ago because it depended on rlog, +# which got removed... only, this didn't actually depend on rlog. Re-adding. +# BUILD=2 because I added a small patch to fix the grammar in the man page. + +# 20180612 bkw: updated for v0.9. script will no longer build old version. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=loggedfs +VERSION=${VERSION:-0.9} +BUILD=${BUILD:-2} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$PRGNAM-$VERSION +chown -R root:root . +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ + +patch -p1 < $CWD/manpage_grammar.diff + +sed -i "s,-Wall,& $SLKCFLAGS," Makefile + +make + +# Do not use 'make install', it's hard-coded to /usr. +mkdir -p $PKG/usr/bin $PKG/usr/man/man1 $PKG/etc +install -s -m0755 $PRGNAM $PKG/usr/bin +install -m0644 $PRGNAM.xml $PKG/etc/$PRGNAM.xml.new +gzip -9c < $PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a LICENSE README* $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/system/loggedfs/loggedfs.info b/system/loggedfs/loggedfs.info new file mode 100644 index 000000000000..0d9afac0383e --- /dev/null +++ b/system/loggedfs/loggedfs.info @@ -0,0 +1,10 @@ +PRGNAM="loggedfs" +VERSION="0.9" +HOMEPAGE="https://rflament.github.io/loggedfs/" +DOWNLOAD="https://github.com/rflament/loggedfs/archive/loggedfs-0.9/loggedfs-loggedfs-0.9.tar.gz" +MD5SUM="d04761535b471a15b7bd4475d0fb3483" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="B. Watson" +EMAIL="urchlay@slackware.uk" diff --git a/system/loggedfs/manpage_grammar.diff b/system/loggedfs/manpage_grammar.diff new file mode 100644 index 000000000000..a6166133fd46 --- /dev/null +++ b/system/loggedfs/manpage_grammar.diff @@ -0,0 +1,29 @@ +diff -Naur loggedfs-loggedfs-0.9/loggedfs.1 loggedfs-loggedfs-0.9.patched/loggedfs.1 +--- loggedfs-loggedfs-0.9/loggedfs.1 2018-03-26 04:34:32.000000000 -0400 ++++ loggedfs-loggedfs-0.9.patched/loggedfs.1 2023-04-23 02:34:49.572040899 -0400 +@@ -11,7 +11,7 @@ + .B ... + .SH DESCRIPTION + .B LoggedFS +-is a transparent fuse-filesystem which allows to log every operations that happens in the backend filesystem. Logs can be written to syslog, to a file, or to the standard output. LoggedFS comes with a XML configuration file in which you can choose exactly what you want to log and what you don't want to log. You can add filters on users, operations (open, read, write, chown, chmod, etc.), filenames , and return code. Filename's filters are regular expressions. ++is a transparent fuse-filesystem which allows logging every operation that happens in the backend filesystem. Logs can be written to syslog, to a file, or to the standard output. LoggedFS comes with an XML configuration file in which you can choose exactly what you want to log and what you don't want to log. You can add filters on users, operations (open, read, write, chown, chmod, etc.), filenames, and return codes. Filename filters are regular expressions. + .SH OPTIONS + .IP -f + Do not start as a daemon. Write logs to stdout if no log file is specified. +@@ -22,13 +22,13 @@ + .IP "-l log-file" + Use the + .I log-file +-to write logs to. If no log file is specified then logs are only written to syslog or to stdout, depending on -f. ++to write logs to. If no log file is specified, then logs are only written to syslog or to stdout, depending on -f. + .IP -p +-Allow every users to see the new loggedfs. ++Allow every user to see the new loggedfs. + .SH FILES + .I /etc/fuse.conf + .RS +-The system wide configuration file. ++The system wide FUSE configuration file. + .RE + .SH AUTHOR + Remi Flament <remipouak@gmail.com> diff --git a/system/loggedfs/slack-desc b/system/loggedfs/slack-desc new file mode 100644 index 000000000000..6df7a4af7cc4 --- /dev/null +++ b/system/loggedfs/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +loggedfs: loggedfs (filesystem monitoring with FUSE) +loggedfs: +loggedfs: LoggedFS is a fuse-based filesystem which can log every operation +loggedfs: that happens in it. Fuse does almost everything. LoggedFS only +loggedfs: sends a message to syslog when called by fuse and then lets the real +loggedfs: filesystem do the rest of the job. +loggedfs: +loggedfs: +loggedfs: +loggedfs: +loggedfs: |