You are not logged in.

#1 2014-12-24 02:20:20

iaw4
Member
Registered: 2014-11-28
Posts: 46

logging all file opens immediately at systemd boot?

when I start my stage-2 systemd boot, I want to log every file that is being opened for reading or writing (to /var/log/accessed.log).  am I reinventing the wheel if I write this or is there already a standard service that does this?


my plan is to use the fanotify_event framework to write a file logger, presumably with a service file like.

[Unit]
Description=fanotify-logger
DefaultDependencies=no
After=local-fs.target

[Service]
Type=oneshot
ExecStart=/usr/local/bin/fanotify-all / /var/log/accessed.log

is there a best-practices recommendation where local sysadmins should insert such services (e.g., which directory, steps, etc.)  and, does my logger need to know how to shutdown, or will the standard systemd service shut this down by itself?

/iaw

Offline

Board footer

Powered by FluxBB