From 805937f418dc687ca8bbfceaa69449ce6a25a95b Mon Sep 17 00:00:00 2001 From: Adam Ruzicka Date: Thu, 3 Oct 2024 13:46:11 +0200 Subject: [PATCH] Fix executable name in new service --- Makefile | 5 +++-- data/com.redhat.Yggdrasil1.Worker1.foreman.service.in | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7cef208..9dbe813 100644 --- a/Makefile +++ b/Makefile @@ -10,14 +10,14 @@ go_sources := $(wildcard src/*.go) build: $(go_sources) mkdir -p build - CGO_ENABLED=0 go build -o build/foreman_worker $^ + CGO_ENABLED=0 go build -o build/$(PKGNAME) $^ .PHONY: data data: build/data/com.redhat.Yggdrasil1.Worker1.foreman.conf build/data/com.redhat.Yggdrasil1.Worker1.foreman.service .PHONY: install install: build data - install -D -m 755 build/foreman_worker $(DESTDIR)$(LIBEXECDIR)/foreman_worker + install -D -m 755 build/$(PKGNAME) $(DESTDIR)$(LIBEXECDIR)/$(PKGNAME) install -D -m 644 build/data/com.redhat.Yggdrasil1.Worker1.foreman.conf $(DESTDIR)/usr/share/dbus-1/system.d/com.redhat.Yggdrasil1.Worker1.foreman.conf install -D -m 644 data/dbus_com.redhat.Yggdrasil1.Worker1.foreman.service $(DESTDIR)/usr/share/dbus-1/system-services/com.redhat.Yggdrasil1.Worker1.foreman.service install -D -m 644 build/data/com.redhat.Yggdrasil1.Worker1.foreman.service $(DESTDIR)/usr/lib/systemd/system/com.redhat.Yggdrasil1.Worker1.foreman.service @@ -52,4 +52,5 @@ build/data/%: data/%.in sed \ -e 's,[@]libexecdir[@],$(LIBEXECDIR),g' \ -e 's,[@]worker_group[@],$(WORKER_GROUP),g' \ + -e 's,[@]executable[@],$(PKGNAME),g' \ $< > $@ diff --git a/data/com.redhat.Yggdrasil1.Worker1.foreman.service.in b/data/com.redhat.Yggdrasil1.Worker1.foreman.service.in index 24ec132..609f7f6 100644 --- a/data/com.redhat.Yggdrasil1.Worker1.foreman.service.in +++ b/data/com.redhat.Yggdrasil1.Worker1.foreman.service.in @@ -6,7 +6,7 @@ Documentation=https://github.com/theforeman/foreman_ygg_worker Type=dbus User=root Group=@worker_group@ -ExecStart=@libexecdir@/foreman_worker +ExecStart=@libexecdir@/@executable@ BusName=com.redhat.Yggdrasil1.Worker1.foreman [Install]