$OpenBSD: patch-google_compute_engine_instance_setup_instance_setup_py,v 1.1.1.1 2017/06/29 14:35:10 ajacoutot Exp $

Index: google_compute_engine/instance_setup/instance_setup.py
--- google_compute_engine/instance_setup/instance_setup.py.orig
+++ google_compute_engine/instance_setup/instance_setup.py
@@ -142,17 +142,9 @@ class InstanceSetup(object):
   def _StartSshd(self):
     """Initialize the SSH daemon."""
     # Exit as early as possible.
-    # Instance setup systemd scripts block sshd from starting.
-    if os.path.exists('/bin/systemctl'):
-      return
-    elif (os.path.exists('/etc/init.d/ssh') or
-          os.path.exists('/etc/init/ssh.conf')):
-      subprocess.call(['service', 'ssh', 'start'])
-      subprocess.call(['service', 'ssh', 'reload'])
-    elif (os.path.exists('/etc/init.d/sshd') or
-          os.path.exists('/etc/init/sshd.conf')):
-      subprocess.call(['service', 'sshd', 'start'])
-      subprocess.call(['service', 'sshd', 'reload'])
+    if (os.path.exists('/etc/rc.d/sshd')):
+      subprocess.call(['/etc/rc.d/sshd', 'start'])
+      subprocess.call(['/etc/rc.d/sshd', 'reload'])
 
   def _SetSshHostKeys(self):
     """Regenerates SSH host keys when the VM is restarted with a new IP address.
