vsphere-hostname: check that /etc/hostname is not empty
In Fedora 37 an empty /etc/hostname file is created, so vsphere-hostname
should check that hostname file contains something instead of just
checking that the file exists.
This also bumps StartLimitIntervalSec to make service retry indefinitely
@@ -7,7 +7,6 @@ contents:
# only run if the hostname is not set
test -s /etc/hostname && exit 0 || :
- echo "Current hostname: $(cat /etc/hostname)"
if vm_name=$(/bin/vmtoolsd --cmd 'info-get guestinfo.hostname'); then
/usr/bin/hostnamectl set-hostname --static ${vm_name}
