Skip to content

Commit

Permalink
move sclockadj compilation from postinst to systemd unit
Browse files Browse the repository at this point in the history
to allow simplification of dependency resolution during release upgrade
  • Loading branch information
adrelanos committed Oct 23, 2021
1 parent cb27e50 commit 3986d42
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
2 changes: 0 additions & 2 deletions debian/sdwdate.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ case "$1" in
## Not possible here, because
## group systemd-journal might not exist yet during the build process.
#addgroup sdwdate systemd-journal

gcc /usr/libexec/sdwdate/sclockadj.c -o /usr/libexec/sdwdate/sclockadj -ldl -D_GNU_SOURCE -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -Wl,-z,now
;;

abort-upgrade|abort-remove|abort-deconfigure)
Expand Down
19 changes: 19 additions & 0 deletions lib/systemd/system/sdwdate-pre.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Copyright (C) 2012 - 2021 ENCRYPTED SUPPORT LP <adrelanos@whonix.org>
## See the file COPYING for copying conditions.

## similar file by package apparmor-profile-everything (AAE):
## /lib/systemd/system/sdwdate-aae.service

[Unit]
Description=Secure Distributed Web Date - Pre
Documentation=https://www.whonix.org/wiki/sdwdate

Before=sdwdate.service

[Service]
Type=oneshot
ExecStart=/usr/libexec/sdwdate/sdwdate-pre
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
1 change: 0 additions & 1 deletion lib/systemd/system/sdwdate.service
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Conflicts=systemd-timesyncd.service
Type=notify
User=sdwdate
Group=sdwdate
ExecStartPre=+/usr/libexec/sdwdate/sdwdate-pre
ExecStart=/usr/bin/sdwdate
SuccessExitStatus=143
TimeoutSec=30
Expand Down
4 changes: 2 additions & 2 deletions usr/libexec/sdwdate/sdwdate-pre
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ set -x
## cause ependency issues during the build process or distro morphing because
## package 'systemd' as well as package 'sdwdate' 'Provides: time-daemon'.
## 'addgroup' is a debianism.
addgroup sdwdate systemd-journal
addgroup sdwdate systemd-journal || true

exit 0
gcc /usr/libexec/sdwdate/sclockadj.c -o /usr/libexec/sdwdate/sclockadj -ldl -D_GNU_SOURCE -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -Wl,-z,now

0 comments on commit 3986d42

Please sign in to comment.