From ce381ff78802d3cc89a9c31d3db48416f82012f4 Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Wed, 7 Dec 2016 11:41:08 -0800 Subject: [PATCH] contrib/systemd: Update bootcfg systemd units --- contrib/systemd/bootcfg-for-tectonic.service | 24 ++++++++++++++++++++ contrib/systemd/bootcfg-local.service | 16 +++++++++++++ contrib/systemd/bootcfg-on-coreos.service | 14 ++++++------ contrib/systemd/bootcfg.service | 5 ++-- 4 files changed, 49 insertions(+), 10 deletions(-) create mode 100644 contrib/systemd/bootcfg-for-tectonic.service create mode 100644 contrib/systemd/bootcfg-local.service diff --git a/contrib/systemd/bootcfg-for-tectonic.service b/contrib/systemd/bootcfg-for-tectonic.service new file mode 100644 index 00000000..e06fca26 --- /dev/null +++ b/contrib/systemd/bootcfg-for-tectonic.service @@ -0,0 +1,24 @@ +[Unit] +Description=CoreOS bootcfg Server +Documentation=https://github.com/coreos/coreos-baremetal + +[Service] +Environment="IMAGE=quay.io/coreos/bootcfg" +Environment="VERSION=v0.4.1" +Environment="BOOTCFG_ADDRESS=0.0.0.0:8080" +Environment="BOOTCFG_RPC_ADDRESS=0.0.0.0:8081" +Environment="BOOTCFG_LOG_LEVEL=debug" +ExecStartPre=/usr/bin/mkdir -p /etc/bootcfg +ExecStartPre=/usr/bin/mkdir -p /var/lib/bootcfg/assets +ExecStart=/usr/bin/rkt run \ + --net=host \ + --inherit-env \ + --trust-keys-from-https \ + --mount volume=data,target=/var/lib/bootcfg \ + --mount volume=config,target=/etc/bootcfg \ + --volume data,kind=host,source=/var/lib/bootcfg \ + --volume config,kind=host,source=/etc/bootcfg \ + ${IMAGE}:${VERSION} + +[Install] +WantedBy=multi-user.target diff --git a/contrib/systemd/bootcfg-local.service b/contrib/systemd/bootcfg-local.service new file mode 100644 index 00000000..08b65ddb --- /dev/null +++ b/contrib/systemd/bootcfg-local.service @@ -0,0 +1,16 @@ +[Unit] +Description=CoreOS bootcfg Server +Documentation=https://github.com/coreos/coreos-baremetal + +[Service] +User=bootcfg +Group=bootcfg +Environment="BOOTCFG_ADDRESS=0.0.0.0:8080" +ExecStart=/usr/local/bin/bootcfg + +# systemd.exec +ProtectHome=yes +ProtectSystem=full + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/contrib/systemd/bootcfg-on-coreos.service b/contrib/systemd/bootcfg-on-coreos.service index 4d8ee69d..debae20d 100644 --- a/contrib/systemd/bootcfg-on-coreos.service +++ b/contrib/systemd/bootcfg-on-coreos.service @@ -3,20 +3,20 @@ Description=CoreOS bootcfg Server Documentation=https://github.com/coreos/coreos-baremetal [Service] +Environment="IMAGE=quay.io/coreos/bootcfg" +Environment="VERSION=v0.4.1" +Environment="BOOTCFG_ADDRESS=0.0.0.0:8080" +ExecStartPre=/usr/bin/mkdir -p /etc/bootcfg ExecStartPre=/usr/bin/mkdir -p /var/lib/bootcfg/assets ExecStart=/usr/bin/rkt run \ --net=host \ + --inherit-env \ + --trust-keys-from-https \ --mount volume=data,target=/var/lib/bootcfg \ --mount volume=config,target=/etc/bootcfg \ --volume data,kind=host,source=/var/lib/bootcfg \ --volume config,kind=host,source=/etc/bootcfg \ - quay.io/coreos/bootcfg:v0.4.1 -- -address=0.0.0.0:8080 -rpc-address=0.0.0.0:8081 -log-level=debug - -# systemd.exec -ProtectHome=yes -ProtectSystem=full -ReadOnlyPaths=/etc/bootcfg -ReadWritePaths=/var/lib/bootcfg + ${IMAGE}:${VERSION} [Install] WantedBy=multi-user.target diff --git a/contrib/systemd/bootcfg.service b/contrib/systemd/bootcfg.service index b1ea3d66..3234b188 100644 --- a/contrib/systemd/bootcfg.service +++ b/contrib/systemd/bootcfg.service @@ -5,13 +5,12 @@ Documentation=https://github.com/coreos/coreos-baremetal [Service] User=bootcfg Group=bootcfg -ExecStart=/usr/local/bin/bootcfg -address=0.0.0.0:8080 -rpc-address=0.0.0.0:8081 -log-level=debug +Environment="BOOTCFG_ADDRESS=0.0.0.0:8080" +ExecStart=/usr/bin/bootcfg # systemd.exec ProtectHome=yes ProtectSystem=full -ReadOnlyPaths=/etc/bootcfg -ReadWritePaths=/var/lib/bootcfg [Install] WantedBy=multi-user.target \ No newline at end of file