From dfc161008a876b4accacd7423793d2d9e3e97252 Mon Sep 17 00:00:00 2001 From: Pavel Odintsov Date: Wed, 10 Jan 2024 15:25:04 +0000 Subject: [PATCH] Reworked default systemd unit file to run FastNetMon under regular non root user and switched logging to journald --- src/fastnetmon.service.in | 8 ++++++-- src/packaging/fedora/fastnetmon.service | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/fastnetmon.service.in b/src/fastnetmon.service.in index d23561e..14dbf14 100644 --- a/src/fastnetmon.service.in +++ b/src/fastnetmon.service.in @@ -5,10 +5,14 @@ After=network.target remote-fs.target [Service] Type=simple -ExecStart=@CMAKE_INSTALL_SBINDIR@/fastnetmon +ExecStart=@CMAKE_INSTALL_SBINDIR@/fastnetmon --log_to_console +User=fastnetmon +Group=fastnetmon Restart=on-failure RestartSec=3 LimitNOFILE=65535 - +# We need it to use AF_PACKET and AF_XDP when run under non root user +AmbientCapabilities=CAP_NET_RAW CAP_IPC_LOCK + [Install] WantedBy=multi-user.target diff --git a/src/packaging/fedora/fastnetmon.service b/src/packaging/fedora/fastnetmon.service index 886588e..5ab8ad1 100644 --- a/src/packaging/fedora/fastnetmon.service +++ b/src/packaging/fedora/fastnetmon.service @@ -11,7 +11,7 @@ Group=fastnetmon Restart=on-failure RestartSec=3 LimitNOFILE=65535 -# We need it to use AF_PACKET when run under non root user +# We need it to use AF_PACKET and AF_XDP when run under non root user AmbientCapabilities=CAP_NET_RAW CAP_IPC_LOCK [Install]