When you enable syslog in /opt/thinlinc/etc/conf.d/vsmagent.hconf and sets syslog_host=syslog. If "syslog" is not resolvable, the server crashes on startup. # systemctl status vsmagent ● vsmagent.service - ThinLinc VSM agent Loaded: loaded (/usr/lib/systemd/system/vsmagent.service; enabled; vendor preset: disabled) Active: failed (Result: timeout) since Mon 2022-09-26 19:51:45 CEST; 5min ago Process: 3402 ExecStart=/bin/bash --login -c /opt/thinlinc/sbin/vsmagent (code=exited, status=0/SUCCESS) Sep 26 19:50:15 thinlinc systemd[1]: Starting ThinLinc VSM agent... Sep 26 19:50:15 thinlinc systemd[1]: vsmagent.service: Can't open PID file /var/run/vsmagent.pid (yet?) after start: No such file or directory Sep 26 19:51:45 thinlinc systemd[1]: vsmagent.service: start operation timed out. Terminating. Sep 26 19:51:45 thinlinc systemd[1]: vsmagent.service: Failed with result 'timeout'. Sep 26 19:51:45 thinlinc systemd[1]: Failed to start ThinLinc VSM agent. The /var/log/vsmagent.log is a bit clearer ... File "/opt/thinlinc/sbin/vsmagent", line 18, in <module> OOoOoo000O00 ( ) File "/opt/thinlinc/sbin/vsmagent", line 15, in OOoOoo000O00 VSMAgent ( sys . argv ) File "/opt/thinlinc/modules/thinlinc/vsm/vsmagent.py", line 116, in __init__ self . setup_logging ( ) File "/opt/thinlinc/modules/thinlinc/vsm/vsmagent.py", line 174, in setup_logging fd = sys . stdout ) File "/opt/thinlinc/modules/thinlinc/tllogger.py", line 92, in __init__ i1Ii1iiIiI111 = logging . handlers . SysLogHandler ( Oo0 , Ooo00ooO ) File "/usr/lib64/python3.6/logging/handlers.py", line 837, in __init__ ress = socket.getaddrinfo(host, port, 0, socktype) File "/usr/lib64/python3.6/socket.py", line 745, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -2] Name or service not known Error in atexit._run_exitfuncs: Traceback (most recent call last): File "/usr/lib64/python3.6/logging/__init__.py", line 1946, in shutdown h.close() File "/usr/lib64/python3.6/logging/handlers.py", line 900, in close self.socket.close() AttributeError: 'SysLogHandler' object has no attribute 'socket' How about a nice message like "vsmagent can't resolv syslog, exiting..." :-) A nice bonus would be adding a "vsmconftest" for basic and/or extended testing of configuration files ( like sshd -t ). Would fit nice in ansible validate environments.
Hello again! I have done some more research about this issue. It does not matter if the syslog host is resolvable or not. The vsmagent does not start anyway if syslog is enabled. I think the problem behind this is the startup configuration in systemd. If I enable syslog with a resolvable hostname, the vsmagent does not start If I enable syslog with a unresolvable hostname, the vsmagent does not start. If I enable syslog with a IP address, the vsmagent starts normally. If I change the startup script. # cd /etc/systemd/system # cp /usr/lib/systemd/system/vsm* . change the "After" tag from: After=network.target to After=network-online.target. If I enable syslog with a resolvable hostname, the vsmagent starts normally. If I enable syslog with a unresolvable hostname, the vsmagent does not start. If I enable syslog with a IP address, the vsmagent starts normally. This is better than nothing...
Hi Peter, Thank you for the report. ThinLinc does support logging directly to a remote syslog server. Wouldn't a more common scenario be to configure the logging for the vsm services to a local syslog first (by setting log_to_syslog=1 and leave out syslog_host), and then configure syslog to send logs to a remote system? The advantage would be that the configuration is done in one place, instead of per application. Could you share a bit more about the use case with us, is this something vital for your set-up?
I agree! Configure log_to_syslog=1 for using to local syslog service is enough for me. Maybe an options for facility/level
(In reply to Peter Wirdemo from comment #3) > Maybe an options for facility/level Found the syslog_facility config parameter.
This should affect all services since they all use the same logging system, so changing component.