Skip to content

Commit

Permalink
Merge branch 'topic/mdc-1151'
Browse files Browse the repository at this point in the history
  • Loading branch information
hmh committed Oct 7, 2021
2 parents dde1717 + c3063f9 commit 0fe011b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
8 changes: 6 additions & 2 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ override_dh_install:
> debian/etc.apt.sources.list.d/nicbr-simet.apt.source.list
dh_install

# Ubuntu xenial and Debian jessie can't deal with --no-restart-after-upgrade without
# a debhelper backport
override_dh_installinit:
dh_installinit
dh_installinit --name=simet-lmapd
dh_installinit --name=simet-ma --no-restart-after-upgrade --error-handler=true \
|| dh_installinit --name=simet-ma --error-handler=true
dh_installinit --name=simet-lmapd --no-restart-after-upgrade --error-handler=true \
|| dh_installinit --name=simet-lmapd --error-handler=true

5 changes: 3 additions & 2 deletions debian/simet-lmapd.init
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ PIDFILE="${PID_DIR}/lmapd.pid"
LMAPCTL="/opt/simet/bin/lmapctl -j"

START_ARGS="-u $SUSER -c $SUSER --background"
STOP_ARGS="-u $SUSER"
STOP_ARGS="-u $SUSER --retry 10"
DAEMON_ARGS="-j"

# not called on default init-d-script do_restart/reload
Expand Down Expand Up @@ -108,7 +108,8 @@ do_reload() {
}

do_stop_cmd_override() {
$LMAPCTL shutdown || return $?
# hunt down any lmapd running as our user, and signal it
start-stop-daemon --stop --quiet --name $NAME $STOP_ARGS
}

do_status_override() {
Expand Down
8 changes: 8 additions & 0 deletions debian/simet-ma.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ fix_letsencrypt() {

case "$1" in
configure)
if dpkg --compare-versions "$2" le-nl "0.17.6.7~"; then
# try to ensure lmapd really is stopped
# and that the init system knows about it
update-rc.d simet-ma defaults >/dev/null || :
invoke-rc.d simet-lmapd stop || :
start-stop-daemon --stop -u nicbr-simet --quiet --name lmapd --retry 10 || :
fi

adduser --quiet --system --group --no-create-home --home /opt/simet \
--gecos "NIC.br SIMET Measurement Agent" nicbr-simet
chgrp nicbr-simet /opt/simet/etc/simet
Expand Down

0 comments on commit 0fe011b

Please sign in to comment.