How can I kill a stuck LXC container?LXC container troubleshootingunable to start lxc containerHow to log...

Excess Zinc in garden soil

Playing ONE triplet (not three)

It's a yearly task, alright

What has been your most complicated TikZ drawing?

Unreachable code, but reachable with exception

Single word request: Harming the benefactor

Is it true that real estate prices mainly go up?

The three point beverage

Coworker uses her breast-pump everywhere in the office

Giving Plot options defined outside of the Plot expression

Is King K. Rool's down throw to up-special a true combo?

Co-worker team leader wants to inject the crap software product of his friends into our development. What should I say to our common boss?

Does splitting a potentially monolithic application into several smaller ones help prevent bugs?

Make a transparent 448*448 image

If the Captain's screens are out, does he switch seats with the co-pilot?

Sword in the Stone story where the sword was held in place by electromagnets

Time dilation for a moving electronic clock

Can't remove a file with file mode bits a+rw

Do I need to leave some extra space available on the disk which my database log files reside, for log backup operations to successfully occur?

Potentiometer like component

Running a subshell from the middle of the current command

Best approach to update all entries in a list that is paginated?

Want to switch to tankless, but can I use my existing wiring?

Rejected in 4th interview round citing insufficient years of experience



How can I kill a stuck LXC container?


LXC container troubleshootingunable to start lxc containerHow to log into lxc container?lxc-create says container already existsSnapshot of a LXC containerHow to get access from nginx on host OS to files inside lxc-container?Ping to LXC containercan't unbind device in privileged lxc containerslow game graphics in lxc containerLXC container issue













5















I have a new unprivileged LXC container that I just cannot seem to stop. lxc-stop -n dl hangs. lxc-stop -k --nolock -n dl hangs. lxc-ls hangs. lxc-attach -n dl hangs. Nothing works on this container.



I have restarted lcxfs. All that did was upset a privileged container. This is what the current processes for this container look like (from the host).



lxc-start,24434
└─systemd,24446 --system --deserialize 9
├─agetty,25258 --noclear --keep-baud console 115200 38400 9600 vt220
├─agetty,25846 --noclear --keep-baud pts/1 115200 38400 9600 vt220
├─agetty,25878 --noclear --keep-baud pts/3 115200 38400 9600 vt220
├─agetty,25906 --noclear --keep-baud pts/2 115200 38400 9600 vt220
├─agetty,25934 --noclear --keep-baud pts/0 115200 38400 9600 vt220
├─rsyslogd,26016 -n
│ ├─{rsyslogd},26043
│ └─{rsyslogd},26044
└─systemd-journal,25962


And the process states:



$ ps aux | grep -P '24434|24446|25258|25846|25878|25906|25934|25934|26016|26043|26044|25962'
oli 24434 0.0 0.0 43400 3552 ? Ss 10:56 0:00 [lxc monitor] /home/oli/.local/share/lxc dl
100000 24446 0.0 0.1 36896 4972 ? Ss 10:56 0:00 /lib/systemd/systemd --system --deserialize 9
100000 25258 0.0 0.0 15676 2504 pts/0 Ss+ 10:56 0:00 /sbin/agetty --noclear --keep-baud console 115200 38400 9600 vt220
100000 25846 0.0 0.0 15676 2496 pts/1 Ss+ 11:33 0:00 /sbin/agetty --noclear --keep-baud pts/1 115200 38400 9600 vt220
100000 25878 0.0 0.0 15676 2380 pts/3 Ss+ 11:33 0:00 /sbin/agetty --noclear --keep-baud pts/3 115200 38400 9600 vt220
100000 25906 0.0 0.0 15676 2416 pts/2 Ss+ 11:33 0:00 /sbin/agetty --noclear --keep-baud pts/2 115200 38400 9600 vt220
100000 25934 0.0 0.0 15676 2332 pts/0 Ss+ 11:33 0:00 /sbin/agetty --noclear --keep-baud pts/0 115200 38400 9600 vt220
100000 25962 0.0 0.0 35256 3500 ? Ss 11:33 0:00 /lib/systemd/systemd-journald
100104 26016 0.0 0.0 182640 3244 ? Ssl 11:33 0:00 /usr/sbin/rsyslogd -n









share|improve this question
















bumped to the homepage by Community 7 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    5















    I have a new unprivileged LXC container that I just cannot seem to stop. lxc-stop -n dl hangs. lxc-stop -k --nolock -n dl hangs. lxc-ls hangs. lxc-attach -n dl hangs. Nothing works on this container.



    I have restarted lcxfs. All that did was upset a privileged container. This is what the current processes for this container look like (from the host).



    lxc-start,24434
    └─systemd,24446 --system --deserialize 9
    ├─agetty,25258 --noclear --keep-baud console 115200 38400 9600 vt220
    ├─agetty,25846 --noclear --keep-baud pts/1 115200 38400 9600 vt220
    ├─agetty,25878 --noclear --keep-baud pts/3 115200 38400 9600 vt220
    ├─agetty,25906 --noclear --keep-baud pts/2 115200 38400 9600 vt220
    ├─agetty,25934 --noclear --keep-baud pts/0 115200 38400 9600 vt220
    ├─rsyslogd,26016 -n
    │ ├─{rsyslogd},26043
    │ └─{rsyslogd},26044
    └─systemd-journal,25962


    And the process states:



    $ ps aux | grep -P '24434|24446|25258|25846|25878|25906|25934|25934|26016|26043|26044|25962'
    oli 24434 0.0 0.0 43400 3552 ? Ss 10:56 0:00 [lxc monitor] /home/oli/.local/share/lxc dl
    100000 24446 0.0 0.1 36896 4972 ? Ss 10:56 0:00 /lib/systemd/systemd --system --deserialize 9
    100000 25258 0.0 0.0 15676 2504 pts/0 Ss+ 10:56 0:00 /sbin/agetty --noclear --keep-baud console 115200 38400 9600 vt220
    100000 25846 0.0 0.0 15676 2496 pts/1 Ss+ 11:33 0:00 /sbin/agetty --noclear --keep-baud pts/1 115200 38400 9600 vt220
    100000 25878 0.0 0.0 15676 2380 pts/3 Ss+ 11:33 0:00 /sbin/agetty --noclear --keep-baud pts/3 115200 38400 9600 vt220
    100000 25906 0.0 0.0 15676 2416 pts/2 Ss+ 11:33 0:00 /sbin/agetty --noclear --keep-baud pts/2 115200 38400 9600 vt220
    100000 25934 0.0 0.0 15676 2332 pts/0 Ss+ 11:33 0:00 /sbin/agetty --noclear --keep-baud pts/0 115200 38400 9600 vt220
    100000 25962 0.0 0.0 35256 3500 ? Ss 11:33 0:00 /lib/systemd/systemd-journald
    100104 26016 0.0 0.0 182640 3244 ? Ssl 11:33 0:00 /usr/sbin/rsyslogd -n









    share|improve this question
















    bumped to the homepage by Community 7 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      5












      5








      5








      I have a new unprivileged LXC container that I just cannot seem to stop. lxc-stop -n dl hangs. lxc-stop -k --nolock -n dl hangs. lxc-ls hangs. lxc-attach -n dl hangs. Nothing works on this container.



      I have restarted lcxfs. All that did was upset a privileged container. This is what the current processes for this container look like (from the host).



      lxc-start,24434
      └─systemd,24446 --system --deserialize 9
      ├─agetty,25258 --noclear --keep-baud console 115200 38400 9600 vt220
      ├─agetty,25846 --noclear --keep-baud pts/1 115200 38400 9600 vt220
      ├─agetty,25878 --noclear --keep-baud pts/3 115200 38400 9600 vt220
      ├─agetty,25906 --noclear --keep-baud pts/2 115200 38400 9600 vt220
      ├─agetty,25934 --noclear --keep-baud pts/0 115200 38400 9600 vt220
      ├─rsyslogd,26016 -n
      │ ├─{rsyslogd},26043
      │ └─{rsyslogd},26044
      └─systemd-journal,25962


      And the process states:



      $ ps aux | grep -P '24434|24446|25258|25846|25878|25906|25934|25934|26016|26043|26044|25962'
      oli 24434 0.0 0.0 43400 3552 ? Ss 10:56 0:00 [lxc monitor] /home/oli/.local/share/lxc dl
      100000 24446 0.0 0.1 36896 4972 ? Ss 10:56 0:00 /lib/systemd/systemd --system --deserialize 9
      100000 25258 0.0 0.0 15676 2504 pts/0 Ss+ 10:56 0:00 /sbin/agetty --noclear --keep-baud console 115200 38400 9600 vt220
      100000 25846 0.0 0.0 15676 2496 pts/1 Ss+ 11:33 0:00 /sbin/agetty --noclear --keep-baud pts/1 115200 38400 9600 vt220
      100000 25878 0.0 0.0 15676 2380 pts/3 Ss+ 11:33 0:00 /sbin/agetty --noclear --keep-baud pts/3 115200 38400 9600 vt220
      100000 25906 0.0 0.0 15676 2416 pts/2 Ss+ 11:33 0:00 /sbin/agetty --noclear --keep-baud pts/2 115200 38400 9600 vt220
      100000 25934 0.0 0.0 15676 2332 pts/0 Ss+ 11:33 0:00 /sbin/agetty --noclear --keep-baud pts/0 115200 38400 9600 vt220
      100000 25962 0.0 0.0 35256 3500 ? Ss 11:33 0:00 /lib/systemd/systemd-journald
      100104 26016 0.0 0.0 182640 3244 ? Ssl 11:33 0:00 /usr/sbin/rsyslogd -n









      share|improve this question
















      I have a new unprivileged LXC container that I just cannot seem to stop. lxc-stop -n dl hangs. lxc-stop -k --nolock -n dl hangs. lxc-ls hangs. lxc-attach -n dl hangs. Nothing works on this container.



      I have restarted lcxfs. All that did was upset a privileged container. This is what the current processes for this container look like (from the host).



      lxc-start,24434
      └─systemd,24446 --system --deserialize 9
      ├─agetty,25258 --noclear --keep-baud console 115200 38400 9600 vt220
      ├─agetty,25846 --noclear --keep-baud pts/1 115200 38400 9600 vt220
      ├─agetty,25878 --noclear --keep-baud pts/3 115200 38400 9600 vt220
      ├─agetty,25906 --noclear --keep-baud pts/2 115200 38400 9600 vt220
      ├─agetty,25934 --noclear --keep-baud pts/0 115200 38400 9600 vt220
      ├─rsyslogd,26016 -n
      │ ├─{rsyslogd},26043
      │ └─{rsyslogd},26044
      └─systemd-journal,25962


      And the process states:



      $ ps aux | grep -P '24434|24446|25258|25846|25878|25906|25934|25934|26016|26043|26044|25962'
      oli 24434 0.0 0.0 43400 3552 ? Ss 10:56 0:00 [lxc monitor] /home/oli/.local/share/lxc dl
      100000 24446 0.0 0.1 36896 4972 ? Ss 10:56 0:00 /lib/systemd/systemd --system --deserialize 9
      100000 25258 0.0 0.0 15676 2504 pts/0 Ss+ 10:56 0:00 /sbin/agetty --noclear --keep-baud console 115200 38400 9600 vt220
      100000 25846 0.0 0.0 15676 2496 pts/1 Ss+ 11:33 0:00 /sbin/agetty --noclear --keep-baud pts/1 115200 38400 9600 vt220
      100000 25878 0.0 0.0 15676 2380 pts/3 Ss+ 11:33 0:00 /sbin/agetty --noclear --keep-baud pts/3 115200 38400 9600 vt220
      100000 25906 0.0 0.0 15676 2416 pts/2 Ss+ 11:33 0:00 /sbin/agetty --noclear --keep-baud pts/2 115200 38400 9600 vt220
      100000 25934 0.0 0.0 15676 2332 pts/0 Ss+ 11:33 0:00 /sbin/agetty --noclear --keep-baud pts/0 115200 38400 9600 vt220
      100000 25962 0.0 0.0 35256 3500 ? Ss 11:33 0:00 /lib/systemd/systemd-journald
      100104 26016 0.0 0.0 182640 3244 ? Ssl 11:33 0:00 /usr/sbin/rsyslogd -n






      lxc






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 9 '15 at 13:51









      Tim

      20k1586141




      20k1586141










      asked Dec 9 '15 at 13:11









      OliOli

      223k89566766




      223k89566766





      bumped to the homepage by Community 7 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 7 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          2 Answers
          2






          active

          oldest

          votes


















          0














          Force killing the container's systemd process worked for me.



          In your example,



          kill -9 24446





          share|improve this answer































            0














            I keep this command line around to quickly kill all processes with a very high UID (which are in my container):



            ps -ef | grep "^100[0-9][0-9][0-9]" | tr -s " " | cut -f2 -d " " | xargs -I {} kill -9 {}


            Then I can use lxc-start again.



            I also found out that I have less problems with lxc-stop when I use lxc-start -d (in background mode) and then connect using lxc-attach or ssh.






            share|improve this answer























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "89"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f707743%2fhow-can-i-kill-a-stuck-lxc-container%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              Force killing the container's systemd process worked for me.



              In your example,



              kill -9 24446





              share|improve this answer




























                0














                Force killing the container's systemd process worked for me.



                In your example,



                kill -9 24446





                share|improve this answer


























                  0












                  0








                  0







                  Force killing the container's systemd process worked for me.



                  In your example,



                  kill -9 24446





                  share|improve this answer













                  Force killing the container's systemd process worked for me.



                  In your example,



                  kill -9 24446






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 28 '16 at 9:05









                  HRJHRJ

                  344215




                  344215

























                      0














                      I keep this command line around to quickly kill all processes with a very high UID (which are in my container):



                      ps -ef | grep "^100[0-9][0-9][0-9]" | tr -s " " | cut -f2 -d " " | xargs -I {} kill -9 {}


                      Then I can use lxc-start again.



                      I also found out that I have less problems with lxc-stop when I use lxc-start -d (in background mode) and then connect using lxc-attach or ssh.






                      share|improve this answer




























                        0














                        I keep this command line around to quickly kill all processes with a very high UID (which are in my container):



                        ps -ef | grep "^100[0-9][0-9][0-9]" | tr -s " " | cut -f2 -d " " | xargs -I {} kill -9 {}


                        Then I can use lxc-start again.



                        I also found out that I have less problems with lxc-stop when I use lxc-start -d (in background mode) and then connect using lxc-attach or ssh.






                        share|improve this answer


























                          0












                          0








                          0







                          I keep this command line around to quickly kill all processes with a very high UID (which are in my container):



                          ps -ef | grep "^100[0-9][0-9][0-9]" | tr -s " " | cut -f2 -d " " | xargs -I {} kill -9 {}


                          Then I can use lxc-start again.



                          I also found out that I have less problems with lxc-stop when I use lxc-start -d (in background mode) and then connect using lxc-attach or ssh.






                          share|improve this answer













                          I keep this command line around to quickly kill all processes with a very high UID (which are in my container):



                          ps -ef | grep "^100[0-9][0-9][0-9]" | tr -s " " | cut -f2 -d " " | xargs -I {} kill -9 {}


                          Then I can use lxc-start again.



                          I also found out that I have less problems with lxc-stop when I use lxc-start -d (in background mode) and then connect using lxc-attach or ssh.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Sep 1 '17 at 16:17









                          antoineMoPaantoineMoPa

                          1112




                          1112






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Ask Ubuntu!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f707743%2fhow-can-i-kill-a-stuck-lxc-container%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              List of shipwrecks in 1808...

                              Is there a lightweight tool to crop images quickly?Cropping Images using Command Line Tools OnlyHow to crop...

                              Unit packagekit.service is masked Announcing the arrival of Valued Associate #679: Cesar...