[ThinLinc-technical] systemd unit file bugs
Jonathan Buzzard
jonathan.buzzard at strath.ac.uk
Wed Jun 2 20:27:52 CEST 2021
First off the vsmagent.service file is being installed with execute
permissions, so I see things like this in my log files
systemd: Configuration file /usr/lib/systemd/system/vsmagent.service is
marked executable. Please remove executable permission bits. Proceeding
anyway.
You can use "systemctl daemon-reload" to trigger it.
Second the way the unit file is written the service agent will fail to
start in many circumstances. So you have the following
[Unit]
Description=ThinLinc VSM agent
After=network.target
Basically using "After=network.target" is about as much use as a
chocolate teapot. What I am seeing on a system where the network
interface is a 802.ad bond is the following
2021-06-01 20:44:29 WARNING vsmagent: Couldn't lookup host
vsmserver.mycorp.com: [Errno -2] Name or service not known
That's because network.target only indicates that the network management
stack is up, it doesn't mean there is a useable network connection. It
takes a handful of seconds after the 802.3ad LAG is started for it to
actually be able to handle traffic. In that time the vsmagent starts
can't lookup the vsmserver hostname and unhelpfully fails.
You may well see the same if the server is doing DHCP to obtain it's IP
address.
What you want is to use the following in your unit file
After=network-online.target
Wants=network-online.target
Though to avoid slowing down the boot, you should probably be watching
rtnetlink and retrying when network reconfigurations happen. The above
modification is basically having systemd working around broken behaviour
in the vsmagent demon.
Note depending on your circumstances you might want to do something like
the following to make the vsmagent wait till any remote file systems are
mounted. For example if users home directories are on an NFS share.
mkdir -p /etc/systemd/system/vsmagent.service.d
echo -e "[Unit]\nAfter=network-online.target remote-fs.target" >
/etc/systemd/system/vsmagent.service.d/waitforremotefs.conf
systemctl daemon-reload
JAB.
--
Jonathan A. Buzzard Tel: +44141-5483420
HPC System Administrator, ARCHIE-WeSt.
University of Strathclyde, John Anderson Building, Glasgow. G4 0NG
More information about the ThinLinc-technical
mailing list