Skip to content

Commit

Permalink
(PE-36861) Add a needrestart conf file for debian packages
Browse files Browse the repository at this point in the history
In Ubuntu 22, needrestart is now called by default whenever a package is installed via apt. Because our packages lay down a temp directory for use by the service, when the services create and modify files in those temp dirs, needrestart thinks the service needs to be restarted. Because we manage restarting our services as needed, this drops a file in /etc/needrestart/conf.d that adds the service to the list of services needrestart should ignore.
  • Loading branch information
Nick Burgan-Illig committed Oct 12, 2023
1 parent eff5936 commit e43660e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
This changelog adheres to [Keep a CHANGELOG](http://keepachangelog.com/).

## [Unreleased]
Added:
* Drop a file in /etc/needrestart/conf.d for deb packages that add the service to the blocklist

## [2.5.3] - 2023-08-03
Bugfix:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ templates:
target: ext/{{{project}}}.logrotate-legacy.conf
- source: ext/ezbake.tmpfiles.conf.erb
target: ext/{{{project}}}.tmpfiles.conf
- source: ext/ezbake.needrestart.conf.erb
target: ext/{{{project}}}.needrestart.conf
- ext/redhat/preinst.erb
- ext/redhat/postinst.erb
- ext/redhat/prerm.erb
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$nrconf{blacklist_rc} = [qr(^<%= EZBake::Config[:project] -%>)]
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ dest_apps_dir="${DESTDIR}${app_prefix}"
app_data=${app_data:=/opt/puppetlabs/server/data/${real_name}}
app_logdir=${app_logdir:=/var/log/puppetlabs/${real_name}}
system_config_dir=${system_config_dir:=${app_prefix}/config}
needrestart_confdir=${needrestart_dir:=/etc/needrestart/conf.d}


##################
Expand Down Expand Up @@ -294,6 +295,8 @@ function task_systemd_deb {
fi
install -d -m 0755 "${DESTDIR}${tmpfilesdir}"
install -m 0644 ext/<%= EZBake::Config[:project] %>.tmpfiles.conf "${DESTDIR}${tmpfilesdir}/<%= EZBake::Config[:project] %>.conf"
install -d -m 0755 "${DESTDIR}${needrestart_confdir}"
install -m 0644 ext/<%= EZBake::Config[:project] %>.needrestart.conf "${DESTDIR}${needrestart_confdir}/<%= EZBake::Config[:project] %>.conf"
}

function task_service_account {
Expand Down

0 comments on commit e43660e

Please sign in to comment.