# Vsmagent does not start if you configure bad syslog server

**URL:** <https://community.thinlinc.com/t/vsmagent-does-not-start-if-you-configure-bad-syslog-server/448>\
**Category:** Community Support\
**Tags:** bug, tlserver\
**Created:** [26 September 2022 18:04 UTC](https://community.thinlinc.com/t/vsmagent-does-not-start-if-you-configure-bad-syslog-server/448 "2022-09-26T18:04:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pewo](https://dub1.discourse-cdn.com/flex005/user_avatar/community.thinlinc.com/pewo/32/46_2.png) [@pewo](https://community.thinlinc.com/u/pewo)\
**Post date:** [26 September 2022 18:04 UTC](https://community.thinlinc.com/t/vsmagent-does-not-start-if-you-configure-bad-syslog-server/448/1 "2022-09-26T18:04:54Z")

</div>

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.

```auto
# 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 …

```auto

  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…” 🙂

---

<div class="post-metadata">

**Author:** ![martin](https://dub1.discourse-cdn.com/flex005/user_avatar/community.thinlinc.com/martin/32/41_2.png) [@martin](https://community.thinlinc.com/u/martin)\
**Post date:** [27 September 2022 06:05 UTC](https://community.thinlinc.com/t/vsmagent-does-not-start-if-you-configure-bad-syslog-server/448/2 "2022-09-27T06:05:32Z")

</div>

Hi @pewo

Thanks for the report! Indeed, this could be handled a lot nicer. Would you mind reporting this in our  
[bugzilla](https://bugzilla.cendio.com)?

Kind regards,  
Martin

---

<div class="post-metadata">

**Author:** ![pewo](https://dub1.discourse-cdn.com/flex005/user_avatar/community.thinlinc.com/pewo/32/46_2.png) [@pewo](https://community.thinlinc.com/u/pewo)\
**Post date:** [27 September 2022 09:33 UTC](https://community.thinlinc.com/t/vsmagent-does-not-start-if-you-configure-bad-syslog-server/448/3 "2022-09-27T09:33:54Z")

</div>

Maybe it’s not a bug that the agent won’t start when incorrect config is entered.  
I will go for RFE 🙂

I will report in bugzilla soon.

---

<div class="post-metadata">

**Author:** ![martin](https://dub1.discourse-cdn.com/flex005/user_avatar/community.thinlinc.com/martin/32/41_2.png) [@martin](https://community.thinlinc.com/u/martin)\
**Post date:** [27 September 2022 10:00 UTC](https://community.thinlinc.com/t/vsmagent-does-not-start-if-you-configure-bad-syslog-server/448/4 "2022-09-27T10:00:24Z")

</div>

Great @pewo !

There’s a maintenance window right now for our Bugzilla, but it should be available shortly 🙂

Regards,  
Martin

---

<div class="post-metadata">

**Author:** ![pewo](https://dub1.discourse-cdn.com/flex005/user_avatar/community.thinlinc.com/pewo/32/46_2.png) [@pewo](https://community.thinlinc.com/u/pewo)\
**Post date:** [5 October 2022 16:13 UTC](https://community.thinlinc.com/t/vsmagent-does-not-start-if-you-configure-bad-syslog-server/448/5 "2022-10-05T16:13:39Z")

</div>

[https://bugzilla.cendio.com/show\_bug.cgi?id=7999](https://bugzilla.cendio.com/show_bug.cgi?id=7999)

---

<div class="post-metadata">

**Author:** ![martin](https://dub1.discourse-cdn.com/flex005/user_avatar/community.thinlinc.com/martin/32/41_2.png) [@martin](https://community.thinlinc.com/u/martin)\
**Post date:** [5 October 2022 16:32 UTC](https://community.thinlinc.com/t/vsmagent-does-not-start-if-you-configure-bad-syslog-server/448/6 "2022-10-05T16:32:36Z")

</div>

Great! Thank you for the bonus suggestion as well 🙂 Greatly appreciated!

Regards,  
Martin
