Skip to content

Commit 8edbeb8

Browse files
Fix/rpm deb packaging (#7445)
* Remove ruby-etc from fpm build - it is no longer a separate package Signed-off-by: Orlando Richards <23049867+Orlando-Richards@users.noreply.github.com> * Fix RPM and deb packaging: correct install paths and protect config files Signed-off-by: Orlando Richards <23049867+Orlando-Richards@users.noreply.github.com> * Include PR number in changelog Signed-off-by: Friedrich Gonzalez <1517449+friedrichg@users.noreply.github.com> * remove whitespace Signed-off-by: Friedrich Gonzalez <1517449+friedrichg@users.noreply.github.com> --------- Signed-off-by: Orlando Richards <23049867+Orlando-Richards@users.noreply.github.com> Signed-off-by: Friedrich Gonzalez <1517449+friedrichg@users.noreply.github.com> Co-authored-by: Friedrich Gonzalez <1517449+friedrichg@users.noreply.github.com>
1 parent 45ebaf7 commit 8edbeb8

4 files changed

Lines changed: 9 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* [BUGFIX] KV store: Fix false-positive `status_code="500"` metrics for HA tracker CAS operations when using memberlist. #7408
2525
* [BUGFIX] Memberlist: Skip nil values delivered by `WatchPrefix` when a key is deleted, preventing a panic in the HA tracker caused by a failed type assertion on a nil interface value. #7429
2626
* [BUGFIX] Tenant Federation: Fix `unsupported character` error when `tenant-federation.regex-matcher-enabled` is enabled and the input regex matches 0 or 1 existing tenant. #7424
27+
* [BUGFIX] Packaging: Fix RPM and deb packages to install the binary to `/usr/bin`, install the systemd unit to the correct system path (`/usr/lib/systemd/system` for RPM, `/lib/systemd/system` for deb), and mark the sysconfig/default env file as a config file so it is not overwritten on upgrade. #7445
2728

2829
## 1.21.0 in progress
2930

Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,20 +362,22 @@ dist/$(UPTODATE)-packages: dist $(wildcard packaging/deb/**) $(wildcard packagin
362362
--architecture $$deb_arch \
363363
--after-install packaging/deb/control/postinst \
364364
--before-remove packaging/deb/control/prerm \
365+
--config-files /etc/default/cortex \
365366
--package dist/cortex-$(VERSION)_$$arch.deb \
366-
dist/cortex-linux-$$arch=/usr/local/bin/cortex \
367+
dist/cortex-linux-$$arch=/usr/bin/cortex \
367368
docs/configuration/single-process-config-blocks.yaml=/etc/cortex/single-process-config.yaml \
368369
packaging/deb/default/cortex=/etc/default/cortex \
369-
packaging/deb/systemd/cortex.service=/etc/systemd/system/cortex.service; \
370+
packaging/deb/systemd/cortex.service=/lib/systemd/system/cortex.service; \
370371
$(FPM_OPTS) -t rpm \
371372
--architecture $$rpm_arch \
372373
--after-install packaging/rpm/control/post \
373374
--before-remove packaging/rpm/control/preun \
375+
--config-files /etc/sysconfig/cortex \
374376
--package dist/cortex-$(VERSION)_$$arch.rpm \
375-
dist/cortex-linux-$$arch=/usr/local/bin/cortex \
377+
dist/cortex-linux-$$arch=/usr/bin/cortex \
376378
docs/configuration/single-process-config-blocks.yaml=/etc/cortex/single-process-config.yaml \
377379
packaging/rpm/sysconfig/cortex=/etc/sysconfig/cortex \
378-
packaging/rpm/systemd/cortex.service=/etc/systemd/system/cortex.service; \
380+
packaging/rpm/systemd/cortex.service=/usr/lib/systemd/system/cortex.service; \
379381
done
380382
for pkg in dist/*.deb dist/*.rpm; do \
381383
sha256sum $$pkg | cut -d ' ' -f 1 > $${pkg}-sha-256; \

packaging/deb/systemd/cortex.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ After=network-online.target
88
Restart=always
99
User=cortex
1010
EnvironmentFile=/etc/default/cortex
11-
ExecStart=/usr/local/bin/cortex --config.file $CONFIG_FILE --log.level $LOG_LEVEL $CUSTOM_ARGS
11+
ExecStart=/usr/bin/cortex --config.file $CONFIG_FILE --log.level $LOG_LEVEL $CUSTOM_ARGS
1212
ExecReload=/bin/kill -HUP $MAINPID
1313
TimeoutStopSec=20s
1414
SendSIGKILL=no

packaging/rpm/systemd/cortex.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ After=network-online.target
88
Restart=always
99
User=cortex
1010
EnvironmentFile=/etc/sysconfig/cortex
11-
ExecStart=/usr/local/bin/cortex --config.file $CONFIG_FILE --log.level $LOG_LEVEL $CUSTOM_ARGS
11+
ExecStart=/usr/bin/cortex --config.file $CONFIG_FILE --log.level $LOG_LEVEL $CUSTOM_ARGS
1212
ExecReload=/bin/kill -HUP $MAINPID
1313
TimeoutStopSec=20s
1414
SendSIGKILL=no

0 commit comments

Comments
 (0)