How do I stop daemonized OpenVPN connection?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite












I started a VPN connection with sudo openvpn --daemon --config connection.ovpn. Is there a way to terminate this connection without using ps to search for the process and then kill it myself?







share|improve this question
























    up vote
    3
    down vote

    favorite












    I started a VPN connection with sudo openvpn --daemon --config connection.ovpn. Is there a way to terminate this connection without using ps to search for the process and then kill it myself?







    share|improve this question






















      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      I started a VPN connection with sudo openvpn --daemon --config connection.ovpn. Is there a way to terminate this connection without using ps to search for the process and then kill it myself?







      share|improve this question












      I started a VPN connection with sudo openvpn --daemon --config connection.ovpn. Is there a way to terminate this connection without using ps to search for the process and then kill it myself?









      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 17 at 4:35









      d3vid

      741427




      741427




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote













          Since OpenVPN does not seem to offer any function of its own for this, you are probably looking for pkill <process-name>, which will search for all processes matching the given name, and kill them.



          If you got multiple instances running, but would like to kill only a specific one, the -f option allows you to match against the full process-call including parameters, e.g. pkill -f "openvpn --config cpnnection.ovpn".



          See the output from ps x or pgrep -lf <process-name> (same as pkill, but doesn't kill them, so essentially similar to ps | grep <name>) to find out with which parameters the daemon was started.






          share|improve this answer



























            up vote
            2
            down vote













            No, you will need to kill the process. In fairness a daemon management script would do just that. You can use pgrep or pkill to make your life easier.






            share|improve this answer




















              Your Answer







              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "106"
              ;
              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',
              convertImagesToLinks: false,
              noModals: false,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );








               

              draft saved


              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f424719%2fhow-do-i-stop-daemonized-openvpn-connection%23new-answer', 'question_page');

              );

              Post as a guest






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              2
              down vote













              Since OpenVPN does not seem to offer any function of its own for this, you are probably looking for pkill <process-name>, which will search for all processes matching the given name, and kill them.



              If you got multiple instances running, but would like to kill only a specific one, the -f option allows you to match against the full process-call including parameters, e.g. pkill -f "openvpn --config cpnnection.ovpn".



              See the output from ps x or pgrep -lf <process-name> (same as pkill, but doesn't kill them, so essentially similar to ps | grep <name>) to find out with which parameters the daemon was started.






              share|improve this answer
























                up vote
                2
                down vote













                Since OpenVPN does not seem to offer any function of its own for this, you are probably looking for pkill <process-name>, which will search for all processes matching the given name, and kill them.



                If you got multiple instances running, but would like to kill only a specific one, the -f option allows you to match against the full process-call including parameters, e.g. pkill -f "openvpn --config cpnnection.ovpn".



                See the output from ps x or pgrep -lf <process-name> (same as pkill, but doesn't kill them, so essentially similar to ps | grep <name>) to find out with which parameters the daemon was started.






                share|improve this answer






















                  up vote
                  2
                  down vote










                  up vote
                  2
                  down vote









                  Since OpenVPN does not seem to offer any function of its own for this, you are probably looking for pkill <process-name>, which will search for all processes matching the given name, and kill them.



                  If you got multiple instances running, but would like to kill only a specific one, the -f option allows you to match against the full process-call including parameters, e.g. pkill -f "openvpn --config cpnnection.ovpn".



                  See the output from ps x or pgrep -lf <process-name> (same as pkill, but doesn't kill them, so essentially similar to ps | grep <name>) to find out with which parameters the daemon was started.






                  share|improve this answer












                  Since OpenVPN does not seem to offer any function of its own for this, you are probably looking for pkill <process-name>, which will search for all processes matching the given name, and kill them.



                  If you got multiple instances running, but would like to kill only a specific one, the -f option allows you to match against the full process-call including parameters, e.g. pkill -f "openvpn --config cpnnection.ovpn".



                  See the output from ps x or pgrep -lf <process-name> (same as pkill, but doesn't kill them, so essentially similar to ps | grep <name>) to find out with which parameters the daemon was started.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 17 at 17:05









                  Folfy

                  1415




                  1415






















                      up vote
                      2
                      down vote













                      No, you will need to kill the process. In fairness a daemon management script would do just that. You can use pgrep or pkill to make your life easier.






                      share|improve this answer
























                        up vote
                        2
                        down vote













                        No, you will need to kill the process. In fairness a daemon management script would do just that. You can use pgrep or pkill to make your life easier.






                        share|improve this answer






















                          up vote
                          2
                          down vote










                          up vote
                          2
                          down vote









                          No, you will need to kill the process. In fairness a daemon management script would do just that. You can use pgrep or pkill to make your life easier.






                          share|improve this answer












                          No, you will need to kill the process. In fairness a daemon management script would do just that. You can use pgrep or pkill to make your life easier.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Feb 19 at 13:53









                          Pedro

                          59429




                          59429






















                               

                              draft saved


                              draft discarded


























                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f424719%2fhow-do-i-stop-daemonized-openvpn-connection%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Popular posts from this blog

                              How to check contact read email or not when send email to Individual?

                              Displaying single band from multi-band raster using QGIS

                              How many registers does an x86_64 CPU actually have?