summaryrefslogtreecommitdiff
path: root/src/system/uacctd_stop.py
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2023-10-18 22:19:02 +0300
committerGitHub <noreply@github.com>2023-10-18 22:19:02 +0300
commit31bea065683b721696e8b705726534919c4ec507 (patch)
tree5107a77338d4fee07dee39e0a61e8e65afc4a29b /src/system/uacctd_stop.py
parent9babc33949827c8f63daa7c21e30b6d9f47f331c (diff)
parenta8d09f501f58d7bf52881101ca840413e8c8df16 (diff)
downloadvyos-1x-31bea065683b721696e8b705726534919c4ec507.tar.gz
vyos-1x-31bea065683b721696e8b705726534919c4ec507.zip
Merge pull request #2375 from vyos/mergify/bp/sagitta/pr-2374
pmacct: T5232: Fixed socket parameters for trigger-packets (backport #2374)
Diffstat (limited to 'src/system/uacctd_stop.py')
-rwxr-xr-xsrc/system/uacctd_stop.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/system/uacctd_stop.py b/src/system/uacctd_stop.py
index 7fbac0566..a1b57335b 100755
--- a/src/system/uacctd_stop.py
+++ b/src/system/uacctd_stop.py
@@ -21,7 +21,7 @@
# send some packets to pmacct to wake it up
from argparse import ArgumentParser
-from socket import socket
+from socket import socket, AF_INET, SOCK_DGRAM
from sys import exit
from time import sleep
@@ -42,11 +42,12 @@ def stop_process(pid: int, timeout: int) -> None:
uacctd.terminate()
# create a socket
- trigger = socket()
+ trigger = socket(AF_INET, SOCK_DGRAM)
first_cycle: bool = True
while uacctd.is_running() and timeout:
- trigger.sendto(b'WAKEUP', ('127.0.254.0', 0))
+ print('sending a packet to uacctd...')
+ trigger.sendto(b'WAKEUP', ('127.0.254.0', 1))
# do not sleep during first attempt
if not first_cycle:
sleep(1)