Make systemd reload only single openvpn process and not the whole group2019 Community Moderator ElectionHow to start 2FA-using OpenVPN with systemd?Not sure what starts this systemd unit filesystemd says permission denied for /bin/shmysql service restarted during user being connected lead to failing servicesystemd and OpenVPN woes after an Ubuntu upgradeWhy x0vncserver is not starting at boot?How to restart systemd service after files update under Gunicorn server?Not sure what starts this systemd unit fileWhy is systemd stopping service immediately after it is started?Instruct to execute an unit after completing another unit successfullyStopping systemd unit together with another. Starting workssystemd not autorestarting the last docker container after it crashes or kill -9 or docker stop service

Circuit Analysis: Obtaining Close Loop OP - AMP Transfer function

Is this toilet slogan correct usage of the English language?

Giving feedback to someone without sounding prejudiced

What features enable the Su-25 Frogfoot to operate with such a wide variety of fuels?

Shouldn’t conservatives embrace universal basic income?

Why Shazam when there is already Superman?

What kind of floor tile is this?

How could a planet have erratic days?

How do you make your own symbol when Detexify fails?

Why is it that I can sometimes guess the next note?

What is the highest possible scrabble score for placing a single tile

Doesn't the system of the Supreme Court oppose justice?

Non-trope happy ending?

What does Apple's new App Store requirement mean

How would you translate "more" for use as an interface button?

C++ copy constructor called at return

How to get directions in deep space?

I found an audio circuit and I built it just fine, but I find it a bit too quiet. How do I amplify the output so that it is a bit louder?

What is going on with gets(stdin) on the site coderbyte?

A variation to the phrase "hanging over my shoulders"

What (the heck) is a Super Worm Equinox Moon?

What is the English pronunciation of "pain au chocolat"?

Is my low blitz game drawing rate at www.chess.com an indicator that I am weak in chess?

Can I cause damage to electrical appliances by unplugging them when they are turned on?



Make systemd reload only single openvpn process and not the whole group



2019 Community Moderator ElectionHow to start 2FA-using OpenVPN with systemd?Not sure what starts this systemd unit filesystemd says permission denied for /bin/shmysql service restarted during user being connected lead to failing servicesystemd and OpenVPN woes after an Ubuntu upgradeWhy x0vncserver is not starting at boot?How to restart systemd service after files update under Gunicorn server?Not sure what starts this systemd unit fileWhy is systemd stopping service immediately after it is started?Instruct to execute an unit after completing another unit successfullyStopping systemd unit together with another. Starting workssystemd not autorestarting the last docker container after it crashes or kill -9 or docker stop service










5















I'm running several openvpn instances on my server with debian stable; as well some clients as a server instance. Right now, when one of these instances fails, systemd seems to kill and restart the whole group of processes:




May 27 12:09:44 tritone systemd[1]: openvpn@client_uk.service: main process exited, code=exited, status=1/FAILURE
May 27 12:09:44 tritone systemd[1]: Unit openvpn@client_uk.service entered failed state.
May 27 12:10:01 tritone systemd[1]: Stopping OpenVPN connection to client_rhode...
May 27 12:10:01 tritone systemd[1]: Starting OpenVPN connection to client_uk...
May 27 12:10:01 tritone systemd[1]: Stopping OpenVPN connection to client_ukraine...
May 27 12:10:01 tritone systemd[1]: Stopping OpenVPN connection to server_udp...
May 27 12:10:01 tritone systemd[1]: Stopping OpenVPN service...
May 27 12:10:01 tritone systemd[1]: Starting OpenVPN service...
May 27 12:10:01 tritone systemd[1]: Started OpenVPN service.
...


This is as well undesired as superfluous imho. Restarting the single failed service would suffice. This is the systemd config from /etc/systemd/system/multi-user.target.wants/openvpn.service:




[Unit]
Description=OpenVPN service
After=network.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
ExecReload=/bin/true
WorkingDirectory=/etc/openvpn

[Install]
WantedBy=multi-user.target


I have seen configs, where ExecReload had been set to kill -HUP $MAINPID, and also my server seems to do this, as systemctl status says:



 Process: 5893 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)


So what I don't understand, where is this kill command defined, if the systemd config ExecReload actually says otherwise? Also, why is the service getting restarted, even if Type=oneshot is defined? Am I looking at the right file at all?



And how should the restart command look like? Kill won't work, as the process is supposedly dead already.



Edit: I found /lib/systemd/system-generators/openvpn-generator and /lib/systemd/system/openvpn@.service now, nevertheless, it remains unclear, when they get run or executed. The generator seems to fail, as none of the links actually got created, probably due to selinux restrictions. Nevertheless, this file seems to be used for init. So I wonder, why is the dummy file /etc/systemd/system/multi-user.target.wants/openvpn.service created at all?










share|improve this question
















bumped to the homepage by Community yesterday


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















  • Could you provide the output of the following commands: $ systemctl -t service | grep openvpn and the output of $ systemctl cat <....>.service for each line from the previous command?

    – Siosm
    Apr 7 '17 at 8:43






  • 1





    Much of this is answered at unix.stackexchange.com/questions/378749 and at unix.stackexchange.com/questions/206058 .

    – JdeBP
    Sep 22 '17 at 8:22















5















I'm running several openvpn instances on my server with debian stable; as well some clients as a server instance. Right now, when one of these instances fails, systemd seems to kill and restart the whole group of processes:




May 27 12:09:44 tritone systemd[1]: openvpn@client_uk.service: main process exited, code=exited, status=1/FAILURE
May 27 12:09:44 tritone systemd[1]: Unit openvpn@client_uk.service entered failed state.
May 27 12:10:01 tritone systemd[1]: Stopping OpenVPN connection to client_rhode...
May 27 12:10:01 tritone systemd[1]: Starting OpenVPN connection to client_uk...
May 27 12:10:01 tritone systemd[1]: Stopping OpenVPN connection to client_ukraine...
May 27 12:10:01 tritone systemd[1]: Stopping OpenVPN connection to server_udp...
May 27 12:10:01 tritone systemd[1]: Stopping OpenVPN service...
May 27 12:10:01 tritone systemd[1]: Starting OpenVPN service...
May 27 12:10:01 tritone systemd[1]: Started OpenVPN service.
...


This is as well undesired as superfluous imho. Restarting the single failed service would suffice. This is the systemd config from /etc/systemd/system/multi-user.target.wants/openvpn.service:




[Unit]
Description=OpenVPN service
After=network.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
ExecReload=/bin/true
WorkingDirectory=/etc/openvpn

[Install]
WantedBy=multi-user.target


I have seen configs, where ExecReload had been set to kill -HUP $MAINPID, and also my server seems to do this, as systemctl status says:



 Process: 5893 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)


So what I don't understand, where is this kill command defined, if the systemd config ExecReload actually says otherwise? Also, why is the service getting restarted, even if Type=oneshot is defined? Am I looking at the right file at all?



And how should the restart command look like? Kill won't work, as the process is supposedly dead already.



Edit: I found /lib/systemd/system-generators/openvpn-generator and /lib/systemd/system/openvpn@.service now, nevertheless, it remains unclear, when they get run or executed. The generator seems to fail, as none of the links actually got created, probably due to selinux restrictions. Nevertheless, this file seems to be used for init. So I wonder, why is the dummy file /etc/systemd/system/multi-user.target.wants/openvpn.service created at all?










share|improve this question
















bumped to the homepage by Community yesterday


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















  • Could you provide the output of the following commands: $ systemctl -t service | grep openvpn and the output of $ systemctl cat <....>.service for each line from the previous command?

    – Siosm
    Apr 7 '17 at 8:43






  • 1





    Much of this is answered at unix.stackexchange.com/questions/378749 and at unix.stackexchange.com/questions/206058 .

    – JdeBP
    Sep 22 '17 at 8:22













5












5








5








I'm running several openvpn instances on my server with debian stable; as well some clients as a server instance. Right now, when one of these instances fails, systemd seems to kill and restart the whole group of processes:




May 27 12:09:44 tritone systemd[1]: openvpn@client_uk.service: main process exited, code=exited, status=1/FAILURE
May 27 12:09:44 tritone systemd[1]: Unit openvpn@client_uk.service entered failed state.
May 27 12:10:01 tritone systemd[1]: Stopping OpenVPN connection to client_rhode...
May 27 12:10:01 tritone systemd[1]: Starting OpenVPN connection to client_uk...
May 27 12:10:01 tritone systemd[1]: Stopping OpenVPN connection to client_ukraine...
May 27 12:10:01 tritone systemd[1]: Stopping OpenVPN connection to server_udp...
May 27 12:10:01 tritone systemd[1]: Stopping OpenVPN service...
May 27 12:10:01 tritone systemd[1]: Starting OpenVPN service...
May 27 12:10:01 tritone systemd[1]: Started OpenVPN service.
...


This is as well undesired as superfluous imho. Restarting the single failed service would suffice. This is the systemd config from /etc/systemd/system/multi-user.target.wants/openvpn.service:




[Unit]
Description=OpenVPN service
After=network.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
ExecReload=/bin/true
WorkingDirectory=/etc/openvpn

[Install]
WantedBy=multi-user.target


I have seen configs, where ExecReload had been set to kill -HUP $MAINPID, and also my server seems to do this, as systemctl status says:



 Process: 5893 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)


So what I don't understand, where is this kill command defined, if the systemd config ExecReload actually says otherwise? Also, why is the service getting restarted, even if Type=oneshot is defined? Am I looking at the right file at all?



And how should the restart command look like? Kill won't work, as the process is supposedly dead already.



Edit: I found /lib/systemd/system-generators/openvpn-generator and /lib/systemd/system/openvpn@.service now, nevertheless, it remains unclear, when they get run or executed. The generator seems to fail, as none of the links actually got created, probably due to selinux restrictions. Nevertheless, this file seems to be used for init. So I wonder, why is the dummy file /etc/systemd/system/multi-user.target.wants/openvpn.service created at all?










share|improve this question
















I'm running several openvpn instances on my server with debian stable; as well some clients as a server instance. Right now, when one of these instances fails, systemd seems to kill and restart the whole group of processes:




May 27 12:09:44 tritone systemd[1]: openvpn@client_uk.service: main process exited, code=exited, status=1/FAILURE
May 27 12:09:44 tritone systemd[1]: Unit openvpn@client_uk.service entered failed state.
May 27 12:10:01 tritone systemd[1]: Stopping OpenVPN connection to client_rhode...
May 27 12:10:01 tritone systemd[1]: Starting OpenVPN connection to client_uk...
May 27 12:10:01 tritone systemd[1]: Stopping OpenVPN connection to client_ukraine...
May 27 12:10:01 tritone systemd[1]: Stopping OpenVPN connection to server_udp...
May 27 12:10:01 tritone systemd[1]: Stopping OpenVPN service...
May 27 12:10:01 tritone systemd[1]: Starting OpenVPN service...
May 27 12:10:01 tritone systemd[1]: Started OpenVPN service.
...


This is as well undesired as superfluous imho. Restarting the single failed service would suffice. This is the systemd config from /etc/systemd/system/multi-user.target.wants/openvpn.service:




[Unit]
Description=OpenVPN service
After=network.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
ExecReload=/bin/true
WorkingDirectory=/etc/openvpn

[Install]
WantedBy=multi-user.target


I have seen configs, where ExecReload had been set to kill -HUP $MAINPID, and also my server seems to do this, as systemctl status says:



 Process: 5893 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)


So what I don't understand, where is this kill command defined, if the systemd config ExecReload actually says otherwise? Also, why is the service getting restarted, even if Type=oneshot is defined? Am I looking at the right file at all?



And how should the restart command look like? Kill won't work, as the process is supposedly dead already.



Edit: I found /lib/systemd/system-generators/openvpn-generator and /lib/systemd/system/openvpn@.service now, nevertheless, it remains unclear, when they get run or executed. The generator seems to fail, as none of the links actually got created, probably due to selinux restrictions. Nevertheless, this file seems to be used for init. So I wonder, why is the dummy file /etc/systemd/system/multi-user.target.wants/openvpn.service created at all?







systemd openvpn






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 27 '15 at 13:43







Michael

















asked May 27 '15 at 11:57









MichaelMichael

1207




1207





bumped to the homepage by Community yesterday


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 yesterday


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














  • Could you provide the output of the following commands: $ systemctl -t service | grep openvpn and the output of $ systemctl cat <....>.service for each line from the previous command?

    – Siosm
    Apr 7 '17 at 8:43






  • 1





    Much of this is answered at unix.stackexchange.com/questions/378749 and at unix.stackexchange.com/questions/206058 .

    – JdeBP
    Sep 22 '17 at 8:22

















  • Could you provide the output of the following commands: $ systemctl -t service | grep openvpn and the output of $ systemctl cat <....>.service for each line from the previous command?

    – Siosm
    Apr 7 '17 at 8:43






  • 1





    Much of this is answered at unix.stackexchange.com/questions/378749 and at unix.stackexchange.com/questions/206058 .

    – JdeBP
    Sep 22 '17 at 8:22
















Could you provide the output of the following commands: $ systemctl -t service | grep openvpn and the output of $ systemctl cat <....>.service for each line from the previous command?

– Siosm
Apr 7 '17 at 8:43





Could you provide the output of the following commands: $ systemctl -t service | grep openvpn and the output of $ systemctl cat <....>.service for each line from the previous command?

– Siosm
Apr 7 '17 at 8:43




1




1





Much of this is answered at unix.stackexchange.com/questions/378749 and at unix.stackexchange.com/questions/206058 .

– JdeBP
Sep 22 '17 at 8:22





Much of this is answered at unix.stackexchange.com/questions/378749 and at unix.stackexchange.com/questions/206058 .

– JdeBP
Sep 22 '17 at 8:22










1 Answer
1






active

oldest

votes


















0














you could try systemctl restart openvpn@CONFIGNAME.service if you use CONFIGNAME as your config file name for your .conf file ...






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',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    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%2funix.stackexchange.com%2fquestions%2f205859%2fmake-systemd-reload-only-single-openvpn-process-and-not-the-whole-group%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    you could try systemctl restart openvpn@CONFIGNAME.service if you use CONFIGNAME as your config file name for your .conf file ...






    share|improve this answer



























      0














      you could try systemctl restart openvpn@CONFIGNAME.service if you use CONFIGNAME as your config file name for your .conf file ...






      share|improve this answer

























        0












        0








        0







        you could try systemctl restart openvpn@CONFIGNAME.service if you use CONFIGNAME as your config file name for your .conf file ...






        share|improve this answer













        you could try systemctl restart openvpn@CONFIGNAME.service if you use CONFIGNAME as your config file name for your .conf file ...







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Aug 9 '18 at 1:57









        dominixdominix

        8518




        8518



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • 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%2funix.stackexchange.com%2fquestions%2f205859%2fmake-systemd-reload-only-single-openvpn-process-and-not-the-whole-group%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

            getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

            Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

            Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.