WireGuard Archive on lore.kernel.org
 help / color / Atom feed
From: "Tomcsányi, Domonkos" <domi@tomcsanyi.net>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: Garrit Franke <garritfranke@gmail.com>,
	 WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: [PATCH] Adding support for reloading configuration via systemd
Date: Fri, 24 Jul 2020 15:09:33 +0200
Message-ID: <CABZXeoBN-0fBVpXnu4=J-ovxxNCXV5FAQ4rGsuaTe2Jecf060g@mail.gmail.com> (raw)
In-Reply-To: <CAHmME9p=i5uPJH3KRisrW6ZojnukYrWS9rjh6mVVnu42i-0Tkw@mail.gmail.com>

On Fri, Jul 24, 2020 at 11:29 AM Jason A. Donenfeld <Jason@zx2c4.com> wrote:
>
> On Fri, Jul 24, 2020 at 11:25 AM Garrit Franke <garritfranke@gmail.com> wrote:
> >
> > On Fri, Jul 24, 2020 at 11:14:52AM +0200, Jason A. Donenfeld wrote:
> > > On Fri, Jul 24, 2020 at 10:30 AM Tomcsanyi, Domonkos <domi@tomcsanyi.net> wrote:
> > > >
> > > > Signed-off-by: Domonkos P. Tomcsanyi <domi@tomcsanyi.net>
> > > > ---
> > > > src/systemd/wg-quick@.service | 1 +
> > > > 1 file changed, 1 insertion(+)
> > > >
> > > > diff --git a/src/systemd/wg-quick@.service b/src/systemd/wg-quick@.service
> > > > index a9cbb58..8eb040b 100644
> > > > --- a/src/systemd/wg-quick@.service
> > > > +++ b/src/systemd/wg-quick@.service
> > > > @@ -15,6 +15,7 @@ Type=oneshot
> > > > RemainAfterExit=yes
> > > > ExecStart=/usr/bin/wg-quick up %i
> > > > ExecStop=/usr/bin/wg-quick down %i
> > > > +ExecReload=/bin/bash -c '/usr/bin/wg syncconf %i <(/usr/bin/wg-quick strip
> > > > %i)'
> > > > Environment=WG_ENDPOINT_RESOLUTION_RETRIES=infinity
> > > >
> > > > [Install]
> > > > --
> > > > 2.17.1
> > > >
> > > > Not the cleanest solution, but I think it might help a lot of people, so I'm
> > > > submitting it.
> > >
> > > This actually doesn't seem too bad to me. Are there cleaner solutions
> > > that I'm not thinking of that I should consider before applying this
> > > patch?
> >
> > I think it doesn't get cleaner than this one-liner.
> > Some time back I submitted a patch that added a restart command to wg-tools.
> > We settled on the conclusion that a systemd approach would be much cleaner.
>
> Right, I recall this conversation, and this patch seems to be what we
> all had in mind there. So I'm just wondering about the "not the
> cleanest" part in the original patch -- if there are other systemd
> tricks or something to consider.


Thanks for the positive feedback guys. I'm not very much experienced
with systemd and frankly this one liner was the first hit from a
simple Google search, hence my comment about it not being the
best/cleanest solution. It suited my needs and it worked, so I decided
to send it in, because the functionality seemed like something other
sysadmins would appreciate.
If you like it and there is currently no other solution suggested by
the list I'd be very happy and proud to have it merged :).

  reply index

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <VI1PR02MB52169D6F055314DCD03746EDE6760@VI1PR02MB5216.eurprd02.prod.outlook.com>
2020-07-23 14:10 ` Tomcsanyi, Domonkos
2020-07-24  9:14   ` Jason A. Donenfeld
2020-07-24  9:25     ` Garrit Franke
2020-07-24  9:27       ` Garrit Franke
2020-07-24  9:29       ` Jason A. Donenfeld
2020-07-24 13:09         ` Tomcsányi, Domonkos [this message]
2020-07-24 14:26           ` Jason A. Donenfeld
2020-07-24 14:46             ` Dominique Martinet
2020-07-24 14:49               ` Jason A. Donenfeld
2020-07-24  9:54       ` Matthias Urlichs
2020-07-24 10:52         ` Stefan Tatschner
2020-07-24 11:00           ` Matthias Urlichs
2020-07-25 12:16     ` Tore Anderson
2020-07-27 15:51       ` Jason A. Donenfeld
2020-07-27 20:04         ` Tore Anderson
2020-07-28  9:03           ` Jason A. Donenfeld
2020-07-28  9:54             ` Tore Anderson
2020-07-28 11:55               ` Jason A. Donenfeld
2020-07-28 12:17                 ` Tore Anderson
2020-07-28 12:17                   ` Jason A. Donenfeld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABZXeoBN-0fBVpXnu4=J-ovxxNCXV5FAQ4rGsuaTe2Jecf060g@mail.gmail.com' \
    --to=domi@tomcsanyi.net \
    --cc=Jason@zx2c4.com \
    --cc=garritfranke@gmail.com \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

WireGuard Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/wireguard/0 wireguard/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 wireguard wireguard/ https://lore.kernel.org/wireguard \
		wireguard@lists.zx2c4.com
	public-inbox-index wireguard

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/com.zx2c4.lists.wireguard


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