Development discussion of WireGuard
 help / color / Atom feed
* [PATCH] systemd: add file wireguard.target
@ 2020-04-30 13:55 mardnh
  2020-04-30 14:01 ` riccardo
  2020-04-30 23:21 ` Jason
  0 siblings, 2 replies; 5+ messages in thread
From: mardnh @ 2020-04-30 13:55 UTC (permalink / raw)


Add file wireguard.target, which allows you to stop or restart all
instances.
---
 src/systemd/wg-quick at .service | 1 +
 src/systemd/wireguard.target  | 2 ++
 2 files changed, 3 insertions(+)
 create mode 100644 src/systemd/wireguard.target

diff --git a/src/systemd/wg-quick at .service b/src/systemd/wg-quick at .service
index 7c5f9d1..c22f7b3 100644
--- a/src/systemd/wg-quick at .service
+++ b/src/systemd/wg-quick at .service
@@ -2,6 +2,7 @@
 Description=WireGuard via wg-quick(8) for %I
 After=network-online.target nss-lookup.target
 Wants=network-online.target nss-lookup.target
+PartOf=wireguard.target
 Documentation=man:wg-quick(8)
 Documentation=man:wg(8)
 Documentation=https://www.wireguard.com/
diff --git a/src/systemd/wireguard.target b/src/systemd/wireguard.target
new file mode 100644
index 0000000..8e59224
--- /dev/null
+++ b/src/systemd/wireguard.target
@@ -0,0 +1,2 @@
+[Unit]
+Description=Target to restart all parts of WireGuard
--
2.26.2



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] systemd: add file wireguard.target
  2020-04-30 13:55 [PATCH] systemd: add file wireguard.target mardnh
@ 2020-04-30 14:01 ` riccardo
  2020-04-30 23:21 ` Jason
  1 sibling, 0 replies; 5+ messages in thread
From: riccardo @ 2020-04-30 14:01 UTC (permalink / raw)


Vouching for this, sounds quite useful.

On 4/30/20 3:55 PM, Martin Hauke wrote:
> Add file wireguard.target, which allows you to stop or restart all
> instances.
> ---
>  src/systemd/wg-quick at .service | 1 +
>  src/systemd/wireguard.target  | 2 ++
>  2 files changed, 3 insertions(+)
>  create mode 100644 src/systemd/wireguard.target
>
> diff --git a/src/systemd/wg-quick at .service b/src/systemd/wg-quick at .service
> index 7c5f9d1..c22f7b3 100644
> --- a/src/systemd/wg-quick at .service
> +++ b/src/systemd/wg-quick at .service
> @@ -2,6 +2,7 @@
>  Description=WireGuard via wg-quick(8) for %I
>  After=network-online.target nss-lookup.target
>  Wants=network-online.target nss-lookup.target
> +PartOf=wireguard.target
>  Documentation=man:wg-quick(8)
>  Documentation=man:wg(8)
>  Documentation=https://www.wireguard.com/
> diff --git a/src/systemd/wireguard.target b/src/systemd/wireguard.target
> new file mode 100644
> index 0000000..8e59224
> --- /dev/null
> +++ b/src/systemd/wireguard.target
> @@ -0,0 +1,2 @@
> +[Unit]
> +Description=Target to restart all parts of WireGuard
> --
> 2.26.2
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] systemd: add file wireguard.target
  2020-04-30 13:55 [PATCH] systemd: add file wireguard.target mardnh
  2020-04-30 14:01 ` riccardo
@ 2020-04-30 23:21 ` Jason
  2020-05-01 21:29   ` mardnh
  1 sibling, 1 reply; 5+ messages in thread
From: Jason @ 2020-04-30 23:21 UTC (permalink / raw)


Hey Martin,

Thanks for the patch. Note that this needs to be submitted with your
`Signed-off-by: ` line, which `git commit -s --amend` will add for
you.

On Thu, Apr 30, 2020 at 7:56 AM Martin Hauke <mardnh at gmx.de> wrote:
> +PartOf=wireguard.target

This won't reset wireguard interfaces configured by systemd-networkd,
nor interfaces configured manually, right? So maybe it's better to
call this wg-quick.target?

> +Description=Target to restart all parts of WireGuard

Is this verbage consistent with other systemd targets? Specifically,
is the "to restart" part apt? Or should this say something more
general?

Jason


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] systemd: add file wireguard.target
  2020-04-30 23:21 ` Jason
@ 2020-05-01 21:29   ` mardnh
  2020-05-01 21:35     ` Jason
  0 siblings, 1 reply; 5+ messages in thread
From: mardnh @ 2020-05-01 21:29 UTC (permalink / raw)


Am 01.05.20 um 01:21 schrieb Jason A. Donenfeld:
> On Thu, Apr 30, 2020 at 7:56 AM Martin Hauke <mardnh at gmx.de> wrote:
>> +PartOf=wireguard.target
>
> This won't reset wireguard interfaces configured by systemd-networkd,
> nor interfaces configured manually, right? So maybe it's better to
> call this wg-quick.target?

Correct, then let's call this wg-quick.target .

>> +Description=Target to restart all parts of WireGuard
>
> Is this verbage consistent with other systemd targets? Specifically,
> is the "to restart" part apt? Or should this say something more
> general?

How about "Description=WireGuard target allowing to start/stop all
wg-quick at .service instances at once" ?

Martin



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] systemd: add file wireguard.target
  2020-05-01 21:29   ` mardnh
@ 2020-05-01 21:35     ` Jason
  0 siblings, 0 replies; 5+ messages in thread
From: Jason @ 2020-05-01 21:35 UTC (permalink / raw)


On Fri, May 1, 2020 at 3:29 PM Martin Hauke <mardnh at gmx.de> wrote:
>
> Am 01.05.20 um 01:21 schrieb Jason A. Donenfeld:
> > On Thu, Apr 30, 2020 at 7:56 AM Martin Hauke <mardnh at gmx.de> wrote:
> >> +PartOf=wireguard.target
> >
> > This won't reset wireguard interfaces configured by systemd-networkd,
> > nor interfaces configured manually, right? So maybe it's better to
> > call this wg-quick.target?
>
> Correct, then let's call this wg-quick.target .
>
> >> +Description=Target to restart all parts of WireGuard
> >
> > Is this verbage consistent with other systemd targets? Specifically,
> > is the "to restart" part apt? Or should this say something more
> > general?
>
> How about "Description=WireGuard target allowing to start/stop all
> wg-quick at .service instances at once" ?

Based on the language pattern established by below,
"Description=WireGuard Tunnels via wg-quick(8)" seems more fitting.

$ rg -g '*.target' ^Description= /lib/systemd
/lib/systemd/system/initrd-fs.target:Description=Initrd File Systems
/lib/systemd/system/printer.target:Description=Printer
/lib/systemd/system/kexec.target:Description=Reboot via kexec
/lib/systemd/system/emergency.target:Description=Emergency Mode
/lib/systemd/system/getty-pre.target:Description=Login Prompts (Pre)
/lib/systemd/system/local-fs.target:Description=Local File Systems
/lib/systemd/system/initrd-root-device.target:Description=Initrd Root Device
/lib/systemd/system/initrd-switch-root.target:Description=Switch Root
/lib/systemd/system/basic.target:Description=Basic System
/lib/systemd/system/umount.target:Description=Unmount All Filesystems
/lib/systemd/system/rescue.target:Description=Rescue Mode
/lib/systemd/system/reboot.target:Description=Reboot
/lib/systemd/system/poweroff.target:Description=Power-Off
/lib/systemd/system/remote-fs-pre.target:Description=Remote File Systems (Pre)
/lib/systemd/system/timers.target:Description=Timers
/lib/systemd/system/network-pre.target:Description=Network (Pre)
/lib/systemd/system/final.target:Description=Final Step
/lib/systemd/system/remote-cryptsetup.target:Description=Remote
Encrypted Volumes
/lib/systemd/system/hibernate.target:Description=Hibernate
/lib/systemd/system/getty.target:Description=Login Prompts
/lib/systemd/system/slices.target:Description=Slices
/lib/systemd/system/boot-complete.target:Description=Boot Completion Check
/lib/systemd/system/nss-user-lookup.target:Description=User and Group
Name Lookups
/lib/systemd/system/nss-lookup.target:Description=Host and Network Name Lookups
/lib/systemd/system/hybrid-sleep.target:Description=Hybrid Suspend+Hibernate
/lib/systemd/system/suspend-then-hibernate.target:Description=Suspend;
Hibernate if not used for a period of time
/lib/systemd/system/sockets.target:Description=Sockets
/lib/systemd/system/paths.target:Description=Paths
/lib/systemd/system/graphical.target:Description=Graphical Interface
/lib/systemd/system/cryptsetup.target:Description=Local Encrypted Volumes
/lib/systemd/system/local-fs-pre.target:Description=Local File Systems (Pre)
/lib/systemd/system/halt.target:Description=Halt
/lib/systemd/system/nfs-client.target:Description=NFS client services
/lib/systemd/system/rpcbind.target:Description=RPC Port Mapper
/lib/systemd/system/machines.target:Description=Containers
/lib/systemd/system/multi-user.target:Description=Multi-User System
/lib/systemd/system/network.target:Description=Network
/lib/systemd/system/swap.target:Description=Swap
/lib/systemd/system/network-online.target:Description=Network is Online
/lib/systemd/system/initrd.target:Description=Initrd Default Target
/lib/systemd/system/initrd-root-fs.target:Description=Initrd Root File System
/lib/systemd/system/smartcard.target:Description=Smart Card
/lib/systemd/system/shutdown.target:Description=Shutdown
/lib/systemd/system/bluetooth.target:Description=Bluetooth
/lib/systemd/system/system-update-pre.target:Description=Offline
System Update (Pre)
/lib/systemd/system/remote-fs.target:Description=Remote File Systems
/lib/systemd/system/time-sync.target:Description=System Time Synchronized
/lib/systemd/system/suspend.target:Description=Suspend
/lib/systemd/system/blockdev at .target:Description=Block Device Preparation for %f
/lib/systemd/system/sleep.target:Description=Sleep
/lib/systemd/system/system-update.target:Description=Offline System Update
/lib/systemd/system/nvmf-connect.target:Description=All instances of
nvmf-autoconnect daemon
/lib/systemd/system/sound.target:Description=Sound Card
/lib/systemd/system/exit.target:Description=Exit the container
/lib/systemd/system/time-set.target:Description=System Time Set
/lib/systemd/system/sysinit.target:Description=System Initialization
/lib/systemd/system/sigpwr.target:Description=Power Failure
/lib/systemd/system/cryptsetup-pre.target:Description=Local Encrypted
Volumes (Pre)


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-30 13:55 [PATCH] systemd: add file wireguard.target mardnh
2020-04-30 14:01 ` riccardo
2020-04-30 23:21 ` Jason
2020-05-01 21:29   ` mardnh
2020-05-01 21:35     ` Jason

Development discussion of WireGuard

Archives are clonable: git clone --mirror http://inbox.vuxu.org/wireguard

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.wireguard


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git