VMware Horizon Community
jcudilla
Contributor
Contributor

./install_viewagent.sh hangs if run during bootup

Hi,

I noticed when running:

cd VMware-horizonagent-linux-x86_64-2212-8.8.0-21071111/
./install_viewagent.sh -A yes

from SSH or console, it runs just fine w/out manual intervention but when run via cron or via rc script /etc/rc.run.d/example-viewagent-upgrade it just hangs behaving like it needs a terminal of some sort(?)

any idea?

For use case context, adding via bootup is to explore an option/automation for a version upgrade such that when user reboots the machine, it may potentially trigger an update "if" a new version is available. Not intended to do on golden image nor instant clones.

0 Kudos
2 Replies
jcudilla
Contributor
Contributor

we found a workaround to exclude the last two lines which seems not needed only for this use case:

$ diff -u install_viewagent.sh.orig install_viewagent.sh
--- install_viewagent.sh.orig 2023-01-05 08:07:11.000000000 -0800
+++ install_viewagent.sh 2023-02-24 22:35:11.503608000 -0800
@@ -4232,5 +4232,10 @@
"$(dirname $0)/bin/XdmcpSecurity.sh" install
configure_recource_limits
vmwdm_setup
-start_service
-restart_system
+###############
+#excluding last two function for two reasons:
+# 1.) it causes the installation via rc script hangs indefinitely
+# 2.) we're gonna bounce the VM anyways after the install/upgrade so ¯\_(ツ)_/¯
+#start_service
+#restart_system
+###############

0 Kudos
yanchaozhang
VMware Employee
VMware Employee

Thank you Jcudilla for sharing your experience on this 🙂

 

the idea sounds interesting, it provide a way for auto updating ...

one small issue here is that, we still need a reboot after agent installation done, and at that point, we need to find some way to disable the installation script from running(again) since we have already done it in last reboot 🙂

for the cron job, I try to reproduce your problem on ubuntu 2204, but failed, the installation finished successfully, am I missed any thing here ?

----------------

root@bat-ub22a2:~# crontab -l
# delete for briefty


# m h dom mon dow command

@Reboot /root/ins.sh

root@bat-ub22a2:~# ll /root/ins.sh
-rwxr-xr-x 1 root root 63 Mar 2 10:52 /root/ins.sh*
root@bat-ub22a2:~# cat /root/ins.sh
cd /root/install_tmp/21360529 && ./install_viewagent.sh -A yes

-------------

It might be helpful for this cronjob problem if you can tell us the distribution you use and share the cronjob script.

0 Kudos