Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 11-05-2015, 01:42 PM   #1
LQ Newbie
Registered: May 2015
Distribution: Void, Guix, Arch
Posts: 15

Rep: Reputation: Disabled
Question Creating a systemd unit for performing a particular action when the network goes down

Via systemd units, I have my VPN app (PIA VPN) set up to be terminated when my laptop suspends, and set-up to re-initialise when the network comes back up (the network automatically goes down when the system suspends and automatically comes back up when it wakes).

Thus I have a systemd unit like this for killing VPN on suspend:

Description=User suspend actions

ExecStart=-/usr/bin/pkill -f pia
ExecStartPost=/usr/bin/sleep 5

And a systemd unit like this for initialising the VPN on network resume:

Description=Restart PIA VPN

ExecStart=/usr/bin/sh /home/emacsomancer/


But what I additionally want (or perhaps in place of the first systemd unit above) is to kill the VPN when the network goes down. I can't figure out how to do this though.


network, systemd, vpn

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: systemd unit file basics LXer Syndicated Linux News 0 10-28-2015 04:11 PM
[SOLVED] systemd unit does not load at startup. manual start shows no such file/dir failure zjmarlow Linux - Newbie 9 07-19-2015 06:19 AM
Creating a systemd unit for gcr raisdead Linux - Newbie 1 11-12-2014 05:32 PM
LXer: Hybrid RAID 1 (Mirror) of RAM drive & SATA HDD Using LVM with LUKS [and systemd unit file] on LXer Syndicated Linux News 0 07-29-2014 10:40 AM
Performing an action every reboot Zaulden Linux - Laptop and Netbook 9 08-03-2005 05:28 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:48 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration