Frantisek,

udev rules are for devices - USB or serial, not for network ports.

the permissions error you are experiencing is probably due the fact that 
you are trying to listen on (bind to) port 80.  only root is allowed to 
bind to ports lower than 1024.

assuming that you are on a linux system, your options include:
- run as root:root
- listen on a higher port (only works if you can change the port on 
whatever is sending data)
- use authbind to let weewx:weewx bind to port 80
- use iptables to REDIRECT traffic from port 80 to a high port
- use CAP_NET_BIND_SERVICE

here is the man page for authbind:

    https://manpages.ubuntu.com/manpages/noble/en/man1/authbind.1.html

stack overflow and superuser have details about CAP_NET_BIND_SERVICE:

    
https://stackoverflow.com/questions/413807/is-there-a-way-for-non-root-processes-to-bind-to-privileged-ports-on-linux

    
https://superuser.com/questions/710253/allow-non-root-process-to-bind-to-port-80-and-443

serverfault shows how to do the iptables redirect:

    
https://serverfault.com/questions/112795/how-to-run-a-server-on-port-80-as-a-normal-user-on-linux

m

On Wednesday, February 7, 2024 at 12:57:45 AM UTC-5 [email protected] wrote:

@Matthew:
Any clue what should be modified (udev rules/group membership) for 
interceptor driver? When I modify systemctl service to not run under 
weewx:weewx everything is OK :)

*Feb  6 19:37:44 rocky-weather-machine weewxd[1612889]: CRITICAL 
weewx.engine:     ****      self.server_bind()*
*Feb  6 19:37:44 rocky-weather-machine weewxd[1612889]: CRITICAL 
weewx.engine:     ****    File "/usr/lib64/python3.6/socketserver.py", line 
470, in server_bind*
*Feb  6 19:37:44 rocky-weather-machine weewxd[1612889]: CRITICAL 
weewx.engine:     ****      self.socket.bind(self.server_address)*
*Feb  6 19:37:44 rocky-weather-machine weewxd[1612889]: CRITICAL 
weewx.engine:     ****  PermissionError: [Errno 13] Operace zamítnuta*
*Feb  6 19:37:44 rocky-weather-machine weewxd[1612889]: CRITICAL __main__: 
Unable to load driver: [Errno 13] Operace zamítnuta*
*Feb  6 19:37:44 rocky-weather-machine systemd[1]: weewx.service: Main 
process exited, code=exited, status=4/NOPERMISSION*
*Feb  6 19:37:44 rocky-weather-machine weewxd[1612889]: CRITICAL __main__:  
   ****  Exiting...*
*Feb  6 19:37:44 rocky-weather-machine systemd[1]: weewx.service: Failed 
with result 'exit-code*



-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/0f771fc2-43b8-4c45-bee6-62dc93250aa2n%40googlegroups.com.

Reply via email to