Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemd won't properly run wirerrd collect without execs when forking #1

Open
mweinelt opened this issue Jan 10, 2017 · 2 comments
Open

Comments

@mweinelt
Copy link

diff --git a/lib/chunks.sh b/lib/chunks.sh
index 2c01b29..42f293f 100644
--- a/lib/chunks.sh
+++ b/lib/chunks.sh
@@ -163,5 +163,5 @@ analyze_chunks() {
 analyze() {
        echo "`date`: Waiting for first chunk"
 
-       inotifywait -q -m "$TMPDIR/raw" -e create -e moved_to | analyze_chunks
+       exec inotifywait -q -m "$TMPDIR/raw" -e create -e moved_to | analyze_chunks
 }
diff --git a/lib/wirerrd-collect.sh b/lib/wirerrd-collect.sh
index 043d944..c1415a5 100755
--- a/lib/wirerrd-collect.sh
+++ b/lib/wirerrd-collect.sh
@@ -10,7 +10,7 @@ THREADS=$((2*`grep -c ^processor /proc/cpuinfo`))
 . ./lib/chunks.sh
 
 run_capture() {
-       dumpcap -q -i "$IFACE" -b duration:60 -w "$TMPDIR/raw/out.cap" 2> /dev/null || {
+       exec dumpcap -q -i "$IFACE" -b duration:60 -w "$TMPDIR/raw/out.cap" 2> /dev/null || {
                echo "Error starting dumpcap" >&2
                kill 0
                exit 1

Additionally the systemd units I'm using:

# /home/hexa/.config/systemd/user/wirerrd-collect.service
[Unit]
Description=wirerrd (collect data)
After=network.target

[Service]
Type=simple
WorkingDirectory=/home/hexa/wirerrd
ExecStart=/home/hexa/wirerrd/wirerrd collect -i ffda-vpn -o data/ffda -f contrib/filters/bcast-stats.rules -j 2

[Install]
WantedBy=multi-user.target
# /home/hexa/.config/systemd/user/wirerrd-export.service
[Unit]
Description=wirerrd (export data)
After=network.target

[Service]
Type=oneshot
WorkingDirectory=/home/hexa/wirerrd
ExecStart=/home/hexa/wirerrd/wirerrd export -i data/ffda -o public_html/ffda
# /home/hexa/.config/systemd/user/wirerrd-export.timer
[Unit]
Description=wirerrd-export timer

[Timer]
OnActiveSec=300
Persistent=true
Unit=wirerrd-export.service

[Install]
WantedBy=basic.target
@mweinelt
Copy link
Author

Current issue with that setup is that data collection is not working properly. Instead of data being appended it is being overwritten afaict.

https://glitch.linuxlounge.net/wirerrd/ffda/

@T-X
Copy link
Owner

T-X commented Jan 21, 2017

As noted on IRC, not an issue of wirerrd, but an issue of the provided systemd unit file.

If someone could provide a working systemd unit, I'd gladly add it to the contrib folder of wirerrd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants