Script to ping computer

Here is a lengthy recap of the steps that lead to success in using (InetAddress, isReachable) on a Linux server (Ubuntu 20.04.5 LTS) with Ignition running as a non-root system user account.

  1. Ran this command...
sudo systemctl edit Ignition-Gateway.service
  1. Added this text... then saved changes.
  1. Restarted the Ignition gateway...
sudo /usr/local/bin/ignition/ -r
  1. Confirmed the service was running without error
sudo systemctl status Ignition-Gateway.service
  1. Confirmed the new settings appeared in the service configuration
sudo systemctl show Ignition-Gateway.service | grep AmbientCapabilities

At this point the InetAddress isreachable function was still not returning any positive results (all fails).
I noticed that the results of the systemctl status Ignition-Gateway.service command was not showing a recent start date so the ` -r' command must not have operated at the systemd service level...

  1. Restarted the Ignition Gateway service using systemctl
sudo systemctl restart Ignition-Gateway.service

Then the isReachable function finally started returning positive results (successful pings).

For completeness here is my version of the ping function:

	def ping(host, timeout=2000):
		from import InetAddress 
		# ( 	
		ip = InetAddress.getByName(host)
		data = { 
		return data
	result = ping('')

Thanks to @silverbacknet , @pturmel and @kcollins1 for your forum posts that helped me sort this out.
Now to see if I can do similar in a docker container.