* [Buildroot] package/quagga: Add systemd service
@ 2016-05-13 12:19 Nathaniel Roach
2016-05-13 13:48 ` Nathaniel Roach
0 siblings, 1 reply; 3+ messages in thread
From: Nathaniel Roach @ 2016-05-13 12:19 UTC (permalink / raw)
To: buildroot
Create a template unit, as there are a few different daemons
available, but all of them accept/use the same basic runtime arguments.
Allow use of a /etc/default/ file to customise each daemon.
(Some daemons, like the zebra backend, have custom flags that cause
other daemons to exit when used)
The zebra backend is required to modify routes on the host system,
so we require it. Systemd handles this just fine, and a circular
dependency is avoided
Signed-off-by: Nathaniel Roach <nroach44@gmail.com>
---
package/quagga/quagga.service | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
create mode 100644 package/quagga/quagga.service
diff --git a/package/quagga/quagga.service b/package/quagga/quagga.service
new file mode 100644
index 0000000..e7ab584
--- /dev/null
+++ b/package/quagga/quagga.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Quagga %i routing daemon
+PartOf=quagga.service
+ReloadPropagatedFrom=quagga.service
+Requires=quagga at zebra.service
+
+[Service]
+PrivateTmp=true
+KillMode=mixed
+Type=forking
+EnvironmentFile=/etc/default/quagga-%i.conf
+ExecStart=/sbin/%i --daemon $OPTS -f /etc/quagga/%i.conf -i /var/run/quagga/%i.pid
+PIDFile=/var/run/quagga/%i.pid
+KillSignal=SIGINT
+Restart=on-failure
+RestartSec=1
+
+[Install]
+WantedBy=multi-user.target
--
2.8.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] package/quagga: Add systemd service
2016-05-13 12:19 [Buildroot] package/quagga: Add systemd service Nathaniel Roach
@ 2016-05-13 13:48 ` Nathaniel Roach
2016-05-17 20:35 ` Thomas Petazzoni
0 siblings, 1 reply; 3+ messages in thread
From: Nathaniel Roach @ 2016-05-13 13:48 UTC (permalink / raw)
To: buildroot
There's two things wrong with this that I've spotted:
Firstly, do we want to run any binary under /sbin? Do we change the
output folder of quagga's ./configure? Do we make a folder with symlinks?
Secondly, I'll change Requires=quagga at zebra.service to Wants= as we
allow building quagga without zebra, and the other dameons can still
talk on the network without it.
Thanks,
Nathaniel
On 13/05/16 20:19, Nathaniel Roach wrote:
> Create a template unit, as there are a few different daemons
> available, but all of them accept/use the same basic runtime arguments.
>
> Allow use of a /etc/default/ file to customise each daemon.
>
> (Some daemons, like the zebra backend, have custom flags that cause
> other daemons to exit when used)
>
> The zebra backend is required to modify routes on the host system,
> so we require it. Systemd handles this just fine, and a circular
> dependency is avoided
>
> Signed-off-by: Nathaniel Roach <nroach44@gmail.com>
> ---
> package/quagga/quagga.service | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
> create mode 100644 package/quagga/quagga.service
>
> diff --git a/package/quagga/quagga.service b/package/quagga/quagga.service
> new file mode 100644
> index 0000000..e7ab584
> --- /dev/null
> +++ b/package/quagga/quagga.service
> @@ -0,0 +1,19 @@
> +[Unit]
> +Description=Quagga %i routing daemon
> +PartOf=quagga.service
> +ReloadPropagatedFrom=quagga.service
> +Requires=quagga at zebra.service
> +
> +[Service]
> +PrivateTmp=true
> +KillMode=mixed
> +Type=forking
> +EnvironmentFile=/etc/default/quagga-%i.conf
> +ExecStart=/sbin/%i --daemon $OPTS -f /etc/quagga/%i.conf -i /var/run/quagga/%i.pid
> +PIDFile=/var/run/quagga/%i.pid
> +KillSignal=SIGINT
> +Restart=on-failure
> +RestartSec=1
> +
> +[Install]
> +WantedBy=multi-user.target
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] package/quagga: Add systemd service
2016-05-13 13:48 ` Nathaniel Roach
@ 2016-05-17 20:35 ` Thomas Petazzoni
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2016-05-17 20:35 UTC (permalink / raw)
To: buildroot
Hello,
On Fri, 13 May 2016 21:48:20 +0800, Nathaniel Roach wrote:
> Firstly, do we want to run any binary under /sbin? Do we change the
> output folder of quagga's ./configure? Do we make a folder with symlinks?
Why wouldn't we want to run a binary from /sbin? What's the problem
with that?
Moreover, keep in mind that when systemd is used, /usr/sbin and /sbin
are the same thing.
> Secondly, I'll change Requires=quagga at zebra.service to Wants= as we
> allow building quagga without zebra, and the other dameons can still
> talk on the network without it.
This is too systemd specific for my knowledge, so I'll trust what you
submit.
Since you said yourself that you will send an updated version with
additional fixes, I've marked this one as Changes Requested in
patchwork.
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-05-17 20:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-13 12:19 [Buildroot] package/quagga: Add systemd service Nathaniel Roach
2016-05-13 13:48 ` Nathaniel Roach
2016-05-17 20:35 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox