New implementation using Python and "watchdog"
This version collects the events in a separate thread, and doesn't gobble up events. So hopefully it's more robust, in addition to being easier to read. One downside of using the "watchdog" module is that it only exposes file/dir modification events. So if I ever want to keep track of opened files, I'll have to call inotifywait again.
This commit is contained in:
@@ -10,7 +10,7 @@ RUN echo "force-unsafe-io" > /etc/dpkg/dpkg.cfg.d/02apt-speedup \
|
||||
|
||||
RUN set -x \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y inotify-tools wget \
|
||||
&& apt-get install -y python3-watchdog wget \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
@@ -29,11 +29,11 @@ RUN chmod a+rwX /files
|
||||
ADD sample.conf /files/sample.conf
|
||||
RUN chmod a+r /files/sample.conf
|
||||
|
||||
# Add scripts. Make sure start.sh and monitor.sh are executable by $UID
|
||||
# Add scripts. Make sure start.sh and monitor.py are executable by $UID
|
||||
ADD start.sh /files/
|
||||
RUN chmod a+x /files/start.sh
|
||||
ADD monitor.sh /files/
|
||||
RUN chmod a+x /files/monitor.sh
|
||||
ADD monitor.py /files/
|
||||
RUN chmod a+x /files/monitor.py
|
||||
ADD runas.sh /files/
|
||||
RUN chmod +x /files/runas.sh
|
||||
ADD mapids.sh /files/
|
||||
|
||||
Reference in New Issue
Block a user