As I explained in the post SRDF SRA 9.2 and the SRM appliance, we use the script enableAutoSSLCertGen.sh to generate the proper hostname that Solutions Enabler uses when communicating in client/server mode. The script is initially run before the SRA install but also must be run each time the SRM appliance is rebooted. As SRM runs on a Linux (PhotonOS) distribution, we can automate this so we don’t have to remember to do it each time. There are lots of ways to do this, so don’t feel you have to do it as I do.
This is just one example of how the automation can be accomplished. And so I don't get in trouble, this is my disclaimer that this process is for informational purposes only. In other words, Dell EMC is not advocating or recommending this solution, nor would they support it since it is not part of the SRA. So use at your own risk.
OK with that out of the way, I used systemd to automate the script in conjunction with a timer. Years ago I probably would have used crontab, and you could install a package that would mimic that functionality on PhotonOS if you want, but the service methodology was pretty easy. I’m not going to include much detail about services in general as there is plenty of documentation on the web, rather I am going to cut to the chase and show you how to implement it.
Creating a service to execute the script
Start by putting the enableAutoSSLCertGen.sh script somewhere it won’t be removed or conflict with VMware’s installs. I put mine in the root home directory, /root. Be sure the permissions are set and that you’ve added the extra line to create the directory /tmp/vmware-root since as I said they have not fixed that yet: mkdir /tmp/vmware-root.
With the script in place, we want to setup two additional files. One is going to be the file that contains the path to the script, the other will setup the timer that executes the script after ‘x’ seconds upon reboot. I’ve listed both files here. The first is enableAutoSSLCertGen.service which contains the service definition and shows my script is in the /root directory. The second is the timer file enableAutoSSLCertGen.timer which will execute my service 30 seconds after reboot which is sufficient for SRM to be running. Place both these files in the /etc/systemd/system directory.
The naming convention is purposeful here. If the service file does not have the same name as the timer file, save for the suffix, then you have to modify the [Unit] section of the timer file to tell it the name of the service. Just keep them the same. Now enable the .timer service with systemctl. We don’t need to enable the .service file as that is being called by the timer.
root@dsib2225 [ /etc/systemd/system ]# ls enableAutoSSLCertGen.* enableAutoSSLCertGen.service enableAutoSSLCertGen.timer root@dsib2225 [ /etc/systemd/system ]# systemctl enable enableAutoSSLCertGen.timer Created symlink /etc/systemd/system/timers.target.wants/enableAutoSSLCertGen.timer -> /etc/systemd/system/enableAutoSSLCertGen.timer. root@dsib2225 [ /etc/systemd/system ]#
With the service added, we can reboot the SRM appliance. In the screenshot below I first show the empty /tmp/vmware-srm directory. Then once the reboot completes, you can see I use a status command against the timer service to watch for the 30 seconds to complete at which point it runs the script. Finally you see the hostname file is now created.
And that’s all it takes. After every reboot the script will run so you need not worry about that hostname file until development updates the SRA with their solution.