Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#64675 - [nebula] Add missing systemd service file

Attached to Project: Community Packages
Opened by Kyle Laker (lakerka) - Thursday, 28 November 2019, 14:38 GMT
Last edited by Robin Broda (coderobe) - Wednesday, 06 May 2020, 21:26 GMT
Task Type Feature Request
Category Packages
Status Closed
Assigned To Robin Broda (coderobe)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:

The nebula upstream project ships a systemd service file that is not included as part of the installation. It can't be since it expects the binaries to be in /usr/local/bin. I am unsure whether it'd be preferred to use sed or a patch to adjust the existing service file or to just ship a custom service file.

A possible patch file to fix the service file is:
```
diff --git a/examples/service_scripts/nebula.service b/examples/service_scripts/nebula.service
index 13c5ff2..67372a9 100644
--- a/examples/service_scripts/nebula.service
+++ b/examples/service_scripts/nebula.service
@@ -8,7 +8,7 @@ SyslogIdentifier=nebula
StandardOutput=syslog
StandardError=syslog
ExecReload=/bin/kill -HUP $MAINPID
-ExecStart=/usr/local/bin/nebula -config /etc/nebula/config.yml
+ExecStart=/usr/bin/nebula -config /etc/nebula/config.yml
Restart=always

[Install]

```

And a patch to the PKGBUILD could be:

```
diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD
index 18ce5e9..f3412e9 100644
--- a/trunk/PKGBUILD
+++ b/trunk/PKGBUILD
@@ -8,8 +8,14 @@ url='https://github.com/slackhq/nebula'
license=('MIT')
depends=()
makedepends=('go-pie')
-source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz")
-sha256sums=('e0585ef37fae1f8db18cdea20648d4087e586b20ff0961ab7eac59a6c9bdafa2')
+source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz" "service.patch")
+sha256sums=('e0585ef37fae1f8db18cdea20648d4087e586b20ff0961ab7eac59a6c9bdafa2'
+ '3171c15df90d9e550bee60601132810c40843f01dbfdcd9836fee3bbe3d26e3b')
+
+prepare() {
+ cd "${pkgname}-${pkgver}"
+ patch --forward --strip=1 --input="${srcdir}/service.patch"
+}

build() {
cd "${pkgname}-${pkgver}"
@@ -37,4 +43,5 @@ package() {
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
install -Dm755 nebula "${pkgdir}/usr/bin/nebula"
install -Dm755 nebula-cert "${pkgdir}/usr/bin/nebula-cert"
+ install -Dm644 examples/service_scripts/nebula.service "${pkgdir}/usr/lib/systemd/system/nebula.service"
}
```

Steps to reproduce:
1. Install package
2. `systemctl enable --now nebula.service`

This task depends upon

Closed by  Robin Broda (coderobe)
Wednesday, 06 May 2020, 21:26 GMT
Reason for closing:  Fixed
Additional comments about closing:  nebula ships a unit file now
Comment by Jeff Wright (jeffw) - Sunday, 05 January 2020, 17:56 GMT
I just created the file myself for now with the alteration, but this would be a nice addition to the package in my opinion. Any ideas why upstream uses "/usr/local/bin"? Is that where you would install the binaries manually (without a package manager)? I wonder if upstream would accept a patch to use "/usr/bin" by default?
Comment by Nate (nbrownus) - Tuesday, 14 January 2020, 05:30 GMT
We can provide a systemd unit in the repo if that is helpful.
Comment by Jeff Wright (jeffw) - Tuesday, 14 January 2020, 22:58 GMT
That would definitely be helpful to me at least.

Edit: Ah, misunderstood who was responding. Not sure what the package maintainer needs.
Comment by Robin Broda (coderobe) - Sunday, 23 February 2020, 09:50 GMT
Yeah, if upstream packages a systemd unit intended for distribution i would install it. the one in the repository is clearly example code which i am not going to patch for distribution :p

Loading...