diff --git a/providers/ec2/tasks/apt.py b/providers/ec2/tasks/apt.py index 1b98776..e039df4 100644 --- a/providers/ec2/tasks/apt.py +++ b/providers/ec2/tasks/apt.py @@ -44,9 +44,9 @@ class AptUpgrade(Task): after = [GenerateLocale, AptSources, DisableDaemonAutostart] def run(self, info): - log_check_call(['chroot', info.root, 'apt-get', 'update']) - log_check_call(['chroot', info.root, 'apt-get', '-f', '-y', 'install']) - log_check_call(['chroot', info.root, 'apt-get', '-y', 'upgrade']) + log_check_call(['/usr/sbin/chroot', info.root, '/usr/bin/apt-get', 'update']) + log_check_call(['/usr/sbin/chroot', info.root, '/usr/bin/apt-get', '-f', '-y', 'install']) + log_check_call(['/usr/sbin/chroot', info.root, '/usr/bin/apt-get', '-y', 'upgrade']) class PurgeUnusedPackages(Task): @@ -54,7 +54,7 @@ class PurgeUnusedPackages(Task): phase = phases.system_cleaning def run(self, info): - log_check_call(['chroot', info.root, 'apt-get', 'autoremove', '--purge']) + log_check_call(['/usr/sbin/chroot', info.root, '/usr/bin/apt-get', 'autoremove', '--purge']) class AptClean(Task): @@ -62,7 +62,7 @@ class AptClean(Task): phase = phases.system_cleaning def run(self, info): - log_check_call(['chroot', info.root, 'apt-get', 'clean']) + log_check_call(['/usr/sbin/chroot', info.root, '/usr/bin/apt-get', 'clean']) lists = os.path.join(info.root, 'var/lib/apt/lists') for list_file in [os.path.join(lists, f) for f in os.listdir(lists)]: diff --git a/providers/ec2/tasks/boot.py b/providers/ec2/tasks/boot.py index 05da41f..4265b9d 100644 --- a/providers/ec2/tasks/boot.py +++ b/providers/ec2/tasks/boot.py @@ -30,8 +30,8 @@ class ConfigureGrub(Task): 'GRUB_HIDDEN_TIMEOUT=true') from common.tools import log_check_call - log_check_call(['chroot', info.root, 'update-grub']) - log_check_call(['chroot', info.root, 'ln', '-s', '/boot/grub/grub.cfg', '/boot/grub/menu.lst']) + log_check_call(['/usr/sbin/chroot', info.root, '/usr/sbin/update-grub']) + log_check_call(['/usr/sbin/chroot', info.root, 'ln', '-s', '/boot/grub/grub.cfg', '/boot/grub/menu.lst']) class BlackListModules(Task): diff --git a/providers/ec2/tasks/filesystem.py b/providers/ec2/tasks/filesystem.py index 9d07caa..a16e852 100644 --- a/providers/ec2/tasks/filesystem.py +++ b/providers/ec2/tasks/filesystem.py @@ -23,8 +23,7 @@ class TuneVolumeFS(Task): def run(self, info): dev_path = info.bootstrap_device['path'] # Disable the time based filesystem check - command = ['/sbin/tune2fs', '-i', '0', dev_path] - log_check_call(command) + log_check_call(['/sbin/tune2fs', '-i', '0', dev_path]) class AddXFSProgs(Task): @@ -60,8 +59,7 @@ class MountVolume(Task): msg = 'Something is already mounted at {root}'.format(root=info.root) raise TaskError(msg) - command = ['mount', info.bootstrap_device['path'], info.root] - log_check_call(command) + log_check_call(['/bin/mount', info.bootstrap_device['path'], info.root]) class MountSpecials(Task): @@ -70,10 +68,10 @@ class MountSpecials(Task): after = [Bootstrap] def run(self, info): - log_check_call(['mount', '--bind', '/dev', '{root}/dev'.format(root=info.root)]) - log_check_call(['chroot', info.root, 'mount', '-t', 'proc', 'none', '/proc']) - log_check_call(['chroot', info.root, 'mount', '-t', 'sysfs', 'none', '/sys']) - log_check_call(['chroot', info.root, 'mount', '-t', 'devpts', 'none', '/dev/pts']) + log_check_call(['/bin/mount', '--bind', '/dev', '{root}/dev'.format(root=info.root)]) + log_check_call(['/usr/sbin/chroot', info.root, '/bin/mount', '-t', 'proc', 'none', '/proc']) + log_check_call(['/usr/sbin/chroot', info.root, '/bin/mount', '-t', 'sysfs', 'none', '/sys']) + log_check_call(['/usr/sbin/chroot', info.root, '/bin/mount', '-t', 'devpts', 'none', '/dev/pts']) class UnmountSpecials(Task): @@ -81,10 +79,10 @@ class UnmountSpecials(Task): phase = phases.volume_unmounting def run(self, info): - log_check_call(['chroot', info.root, 'umount', '/dev/pts']) - log_check_call(['chroot', info.root, 'umount', '/sys']) - log_check_call(['chroot', info.root, 'umount', '/proc']) - log_check_call(['umount', '{root}/dev'.format(root=info.root)]) + log_check_call(['/usr/sbin/chroot', info.root, '/bin/umount', '/dev/pts']) + log_check_call(['/usr/sbin/chroot', info.root, '/bin/umount', '/sys']) + log_check_call(['/usr/sbin/chroot', info.root, '/bin/umount', '/proc']) + log_check_call(['/bin/umount', '{root}/dev'.format(root=info.root)]) class UnmountVolume(Task): @@ -93,7 +91,7 @@ class UnmountVolume(Task): after = [UnmountSpecials] def run(self, info): - log_check_call(['umount', info.root]) + log_check_call(['/bin/umount', info.root]) class DeleteMountDir(Task): diff --git a/providers/ec2/tasks/initd.py b/providers/ec2/tasks/initd.py index 4571c4e..5a479fe 100644 --- a/providers/ec2/tasks/initd.py +++ b/providers/ec2/tasks/initd.py @@ -43,7 +43,7 @@ class InstallInitScripts(Task): dst = os.path.join(info.root, 'etc/init.d', name) copy(src, dst) os.chmod(dst, rwxr_xr_x) - log_check_call(['chroot', info.root, '/sbin/insserv', '-d', name]) + log_check_call(['/usr/sbin/chroot', info.root, '/sbin/insserv', '-d', name]) for name in info.initd['disable']: - log_check_call(['chroot', info.root, '/sbin/insserv', '-r', name]) + log_check_call(['/usr/sbin/chroot', info.root, '/sbin/insserv', '-r', name]) diff --git a/providers/ec2/tasks/locale.py b/providers/ec2/tasks/locale.py index db478fd..de3e434 100644 --- a/providers/ec2/tasks/locale.py +++ b/providers/ec2/tasks/locale.py @@ -16,7 +16,7 @@ class GenerateLocale(Task): search = '# ' + locale_str sed_i(locale_gen, search, locale_str) - command = ['chroot', info.root, 'dpkg-reconfigure', '--priority=critical', 'locales'] + command = ['/usr/sbin/chroot', info.root, '/usr/sbin/dpkg-reconfigure', '--priority=critical', 'locales'] log_check_call(command) diff --git a/providers/ec2/tasks/security.py b/providers/ec2/tasks/security.py index 634c4e3..50d8db6 100644 --- a/providers/ec2/tasks/security.py +++ b/providers/ec2/tasks/security.py @@ -9,7 +9,7 @@ class EnableShadowConfig(Task): def run(self, info): from common.tools import log_check_call - log_check_call(['chroot', info.root, '/sbin/shadowconfig', 'on']) + log_check_call(['/usr/sbin/chroot', info.root, '/sbin/shadowconfig', 'on']) class DisableSSHPasswordAuthentication(Task):