Run script on the server immediately after multicast is done
This is not a technical problem but maybe someone can give me an idea. I need to run a script as root, on the server, after the multicast is done.
Server OS is Ubuntu 16.04,
Thank you for your reply. I thought about this too but I’m a bit uncomfortable with modifying the FOG code. Plus, it would break if I upgrade.
I got another idea yesterday, after writing this post. I was thinking about a script, that would run from cron, about every 10 minutes. It would check if udp-sender is running. If it isn’t, it would just exit. If it is, it would start monitoring the process and, when it finishes, it would launch my custom code.
This would work if udp-sender runs only during multicast. I suppose this is the case. I don’t see any reason for it to run otherwise.
How does this sound?
This isn’t something FOG would manage, though you could modify the FOGMulticastManager service to handle this for you. The file you’d need to edit to allow running the script would be located in /var/www/fog/lib/service/multicastmanager.class.php
You’ll have to see where the script completes tasks and run your script at that point. The FOGMulticastManager is started as root, so the running of your script should run as that same user under this case.