Commit 4bba2629 by Oliver Pinter

use absolute path in call()s

parent cefb7c9e
......@@ -12,9 +12,9 @@ working_directory = sys.path[0]
try:
# load virtio console driver, the device is /dev/ttyV0.1
subprocess.call(('kldload', '-n', 'virtio_console'))
subprocess.call(('/sbin/kldload', '-n', 'virtio_console'))
chdir(working_directory)
subprocess.call(('pip', 'install', '-r', 'requirements.txt'))
subprocess.call(('/usr/local/bin/pip', 'install', '-r', 'requirements.txt'))
copy("/root/agent/misc/vm_renewal", "/usr/local/bin/")
except:
pass # hope it works
......@@ -90,7 +90,7 @@ class Context(BaseContext):
@staticmethod
def restart_networking():
subprocess.call(['/sbin/service', 'netif', 'restart'])
subprocess.call(['/usr/sbin/service', 'netif', 'restart'])
@staticmethod
def change_ip(interfaces, dns):
......@@ -129,7 +129,7 @@ class Context(BaseContext):
with open('/etc/fstab', 'a') as f:
f.write(mount_template_linux % data)
subprocess.call('mount -a', shell=True)
subprocess.call('/sbin/mount -a', shell=True)
@staticmethod
def get_keys():
......@@ -197,10 +197,7 @@ class Context(BaseContext):
@staticmethod
def start_access_server():
try:
subprocess.call(('/sbin/start', 'ssh'))
except OSError:
subprocess.call(('/bin/systemctl', 'start', 'sshd.service'))
subprocess.call(('/usr/sbin/service', 'ssh', 'start'))
@staticmethod
def append(data, filename, chunk_number, uuid):
......
......@@ -88,7 +88,7 @@ def change_ip_freebsd(interfaces, dns):
'gw': conf['gw6' if ip.version == 6 else 'gw4'],
'dns': dns})
for ifname, conf in data:
subprocess.call(('/sbin/ifup', ifname))
subprocess.call(('/usr/sbin/service', 'netif', 'start', ifname))
# example:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment