Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use lxc-stop -k instead of lxc-kill #3844

Merged
merged 1 commit into from Jan 31, 2014

Conversation

clkao
Copy link
Contributor

@clkao clkao commented Jan 30, 2014

lxc-kill was removed in lxc/lxc@33ddfc2

Docker-DCO-1.1-Signed-off-by: Chia-liang Kao clkao@clkao.org (github: clkao)

@tianon
Copy link
Member

tianon commented Jan 30, 2014

We still support older LXC versions, so it isn't quite as simple as this. What we need to do is look for lxc-kill (with LookPath or something similar - maybe even just try running it if that's easier), and if it isn't there, then fall back to lxc-stop -k.

@clkao
Copy link
Contributor Author

clkao commented Jan 30, 2014

Ok, apparently -k landed lxc-stop as of lxc/lxc@3e625e2. I suppose that's not ancient enough

@crosbymichael
Copy link
Contributor

@clkao That is only tagged with 1.0.0alpha, We support lxc as far back as 0.7.5

@tianon
Copy link
Member

tianon commented Jan 30, 2014

Indeed, and we've actually seen the most stability out of LXC 0.8, which also does not have the option yet.

@clkao
Copy link
Contributor Author

clkao commented Jan 30, 2014

Right. I was testing something on trusty, which comes with1.0.0beta3. Perhaps we should make travis smoke with various lxc versions?

@vieux
Copy link
Contributor

vieux commented Jan 30, 2014

@clkao your if statement is wrong, please rename hasNoKill in err and you'll see it's inverted

lxc-kill was removed in lxc/lxc@33ddfc2

Docker-DCO-1.1-Signed-off-by: Chia-liang Kao <clkao@clkao.org> (github: clkao)
@clkao
Copy link
Contributor Author

clkao commented Jan 30, 2014

@vieux fixed, thanks! Sorry I am having trouble with dev env to actually test this

@vieux
Copy link
Contributor

vieux commented Jan 30, 2014

LGTM

@SvenDowideit
Copy link
Contributor

LGTM, thank you - (I'll make a new PR to document the issue for people that are using a pre-0.8 docker)

@SvenDowideit
Copy link
Contributor

for users using docker before this fix, and with lxc versions 1.0.0.beta3 and later, you can create an lxc-kill shell script to do the same thing:

docker@boot2docker:~$ sudo echo "#!/bin/sh" > /usr/local/bin/lxc-kill
docker@boot2docker:~$ sudo echo "lxc-stop -k \$@" >> /usr/local/bin/lxc-kill
docker@boot2docker:~$ chmod +x /usr/local/bin/lxc-kill

(or wherever is reasonable in your path)

SvenDowideit added a commit to SvenDowideit/docker that referenced this pull request Jan 31, 2014
…kill see moby#3844

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)
@crosbymichael
Copy link
Contributor

LGTM

crosbymichael added a commit that referenced this pull request Jan 31, 2014
Use lxc-stop -k instead of lxc-kill
@crosbymichael crosbymichael merged commit f267938 into moby:master Jan 31, 2014
@clkao clkao deleted the lxc-kill-deprecation branch February 1, 2014 08:57
@felixrabe
Copy link
Contributor

@SvenDowideit Careful with sudo something > /privileged-file - that won't work as you expect. Rather use something | sudo tee /privileged-file > /dev/null or whatever. (I'm sure there's a more elegant way.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants