mrash / fwknop

Single Packet Authorization > Port Knocking
http://www.cipherdyne.org/fwknop/
GNU General Public License v2.0
1.12k stars 232 forks source link

Issues with PID File #318

Closed Raybuntu closed 1 year ago

Raybuntu commented 4 years ago

Hi Michael,

I installed fwknop server on ubuntu 20.04. It's 2.6.10. I noticed that systemd kept timing out for no reason. Then I had a look at the pid file:

root 3853550 0.0 0.0 3588 180 ? Ss 06:26 0:00 fwknopd

cat fwknopd.pid 385355

cat /proc/sys/kernel/pid_max 4194304

uname -r 5.4.0-40-generic

Looks like my system has had a lot of processes but the last number in fwknopd pid is truncated.

Thanks Ray

damienstuart commented 4 years ago

It appears the value for PID_BUFLEN in fwknopd.h should be increased. Currently, it is set to 7 which allows for a 6-digit PID value. The default max PID value on 64-bit Ubuntu systems is 4194304 (cat /proc/sys/kernel/pid_max to see that value).

If you are building your own, edit server/fwknopd.h and set PID_BUFLEN to 8.

Raybuntu commented 4 years ago

Ahh thanks. Yeah I might have to build it myself.

mrash commented 4 years ago

Thanks for the bug report and to Damien for pointing out the fix. Obviously this one is pretty fundamental, so I'll get this fixed and make a new release in a couple of days.

On Sat, Jul 18, 2020 at 12:53 PM Raybuntu notifications@github.com wrote:

Ahh thanks. Yeah I might have to build it myself.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mrash/fwknop/issues/318#issuecomment-660510144, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAC42RHXZGHIQZGSOULSRKLR4HHQFANCNFSM4O7PZJXQ .

-- Michael Rash | Founder http://www.cipherdyne.org/ Key fingerprint = 53EA 13EA 472E 3771 894F AC69 95D8 5D6B A742 839F

fmarier commented 4 years ago

If you are using the official Ubuntu packages, you can also apply the fix I released in Debian (and suggested in #317) by removing the PIDFile line in /lib/systemd/system/fwknop-server.service.

It will be part of the next revision of that package on Ubuntu (it's already in Ubuntu 20.10) if they push out a stable release update for that package.