diff --git a/lib/vagrant-lxc/action/clear_forwarded_ports.rb b/lib/vagrant-lxc/action/clear_forwarded_ports.rb index 8f66963..8a7b339 100644 --- a/lib/vagrant-lxc/action/clear_forwarded_ports.rb +++ b/lib/vagrant-lxc/action/clear_forwarded_ports.rb @@ -15,7 +15,7 @@ module Vagrant redir_pids.each do |pid| next unless is_redir_pid?(pid) @logger.debug "Killing pid #{pid}" - system "sudo pkill -TERM -P #{pid}" + system "pkill -TERM -P #{pid}" end remove_redir_pids diff --git a/spec/unit/action/clear_forwarded_ports_spec.rb b/spec/unit/action/clear_forwarded_ports_spec.rb index 97a5f3a..3f9f630 100644 --- a/spec/unit/action/clear_forwarded_ports_spec.rb +++ b/spec/unit/action/clear_forwarded_ports_spec.rb @@ -29,7 +29,7 @@ describe Vagrant::LXC::Action::ClearForwardedPorts do context 'with a valid redir pid' do it 'kills known processes' do - subject.should have_received(:system).with("sudo pkill -TERM -P #{pid}") + subject.should have_received(:system).with("pkill -TERM -P #{pid}") end end @@ -37,7 +37,7 @@ describe Vagrant::LXC::Action::ClearForwardedPorts do let(:pid_cmd) { 'sudo ls' } it 'does not kill the process' do - subject.should_not have_received(:system).with("sudo pkill -TERM -P #{pid}") + subject.should_not have_received(:system).with("pkill -TERM -P #{pid}") end end end