Skip to content

Commit fba2f00

Browse files
authored
Packaging: Unmark systemd service file as a config file (#29004)
Systemd overrides should happen through /etc/systemd/system, not directly editing the service file. This commit removes marking the service file as configuration for rpm and deb packages.
1 parent 7790cb5 commit fba2f00

File tree

5 files changed

+19
-4
lines changed

5 files changed

+19
-4
lines changed

distribution/packages/build.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ Closure commonPackageConfig(String type, boolean oss) {
178178
}
179179

180180
// ========= systemd =========
181-
configurationFile '/usr/lib/systemd/system/elasticsearch.service'
182181
into('/usr/lib/tmpfiles.d') {
183182
from "${packagingFiles}/systemd/elasticsearch.conf"
184183
}

docs/CHANGELOG.asciidoc

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ This section summarizes the changes in each release.
2626
<<write-thread-pool-fallback, Removed `thread_pool.bulk.*` settings and
2727
`es.thread_pool.write.use_bulk_as_display_name` system property>> ({pull}29609[#29609])
2828

29+
<<systemd-service-file-config, Systemd service file is no longer marked as configuration>> ({pull}29004[#29004])
2930
<<remove-suggest-metric, Removed `suggest` metric on stats APIs>> ({pull}29635[#29635])
3031

3132
<<remove-field-caps-body, In field capabilities APIs, removed support for providing fields in the request body>> ({pull}30185[#30185])

docs/reference/migration/migrate_7_0.asciidoc

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Elasticsearch 6.x in order to be readable by Elasticsearch 7.x.
2828
* <<breaking_70_indices_changes>>
2929
* <<breaking_70_mappings_changes>>
3030
* <<breaking_70_search_changes>>
31+
* <<breaking_70_packaging_changes>>
3132
* <<breaking_70_plugins_changes>>
3233
* <<breaking_70_analysis_changes>>
3334
* <<breaking_70_api_changes>>
@@ -41,6 +42,7 @@ include::migrate_7_0/cluster.asciidoc[]
4142
include::migrate_7_0/indices.asciidoc[]
4243
include::migrate_7_0/mappings.asciidoc[]
4344
include::migrate_7_0/search.asciidoc[]
45+
include::migrate_7_0/packaging.asciidoc[]
4446
include::migrate_7_0/plugins.asciidoc[]
4547
include::migrate_7_0/api.asciidoc[]
4648
include::migrate_7_0/java.asciidoc[]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[[breaking_70_packaging_changes]]
2+
=== Packaging changes
3+
4+
[[systemd-service-file-config]]
5+
==== systemd service file is no longer configuration
6+
7+
The systemd service file `/usr/lib/systemd/system/elasticsearch.service`
8+
was previously marked as a configuration file in rpm and deb packages.
9+
Overrides to the systemd elasticsearch service should be made
10+
in `/etc/systemd/system/elasticsearch.service.d/override.conf`.

qa/vagrant/src/test/resources/packaging/tests/30_deb_package.bats

+6-3
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,13 @@ setup() {
131131
# The removal must disable the service
132132
# see prerm file
133133
if is_systemd; then
134-
# Debian systemd distros usually returns exit code 3
134+
missing_exit_code=4
135+
if [ $(systemctl --version | head -1 | awk '{print $2}') -lt 231 ]; then
136+
# systemd before version 231 used exit code 3 when the service did not exist
137+
missing_exit_code=3
138+
fi
135139
run systemctl status elasticsearch.service
136-
[ "$status" -eq 3 ]
140+
[ "$status" -eq $missing_exit_code ]
137141

138142
run systemctl is-enabled elasticsearch.service
139143
[ "$status" -eq 1 ]
@@ -166,7 +170,6 @@ setup() {
166170

167171
# The service files are still here
168172
assert_file_exist "/etc/init.d/elasticsearch"
169-
assert_file_exist "/usr/lib/systemd/system/elasticsearch.service"
170173
}
171174

172175
@test "[DEB] purge package" {

0 commit comments

Comments
 (0)