diff --git a/CHANGELOG b/CHANGELOG index b3809eb..206b3c1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,8 +1,7 @@ tuptime (5.2.4) unstable; urgency=low * Move files from /lib to /usr/lib in DEB package - * Replace adduser with sysusers in DEB package - * Using tmpfiles.d to set DB dir in DEB package + * Replace adduser with sysusers.d in DEB package * Update documentation * Minnor code refactoring diff --git a/debian/changelog b/debian/changelog index a63c5ac..fc3fd5f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,7 @@ tuptime (5.2.4) unstable; urgency=low * Move files from /lib to /usr/lib in DEB package - * Replace adduser with sysusers in DEB package - * Using tmpfiles.d to set DB dir in DEB package + * Replace adduser with sysusers.d in DEB package * Update documentation * Minnor code refactoring diff --git a/debian/tuptime.install b/debian/tuptime.install index aae3ccc..50af949 100644 --- a/debian/tuptime.install +++ b/debian/tuptime.install @@ -1,6 +1,6 @@ src/systemd/tuptime.service usr/lib/systemd/system/ src/systemd/tuptime-sync.service usr/lib/systemd/system/ src/systemd/tuptime-sync.timer usr/lib/systemd/system/ -src/systemd/tuptime-tmpfiles.conf usr/lib/tmpfiles.d/ +src/systemd/sysusers.d/tuptime.conf usr/lib/sysusers.d/ src/init.d/debian/tuptime etc/init.d/ src/tuptime usr/bin/ diff --git a/debian/tuptime.sysusers b/debian/tuptime.sysusers deleted file mode 100644 index b0ca15e..0000000 --- a/debian/tuptime.sysusers +++ /dev/null @@ -1,5 +0,0 @@ -u _tuptime - "Tuptime execution user" /var/lib/tuptime - - -# Note: -# systemd-sysusers doesn't create home directories. Use in combination with tmpfiles.d diff --git a/src/systemd/sysusers.d/tuptime.conf b/src/systemd/sysusers.d/tuptime.conf new file mode 100644 index 0000000..bfd934d --- /dev/null +++ b/src/systemd/sysusers.d/tuptime.conf @@ -0,0 +1,6 @@ +u _tuptime - "Tuptime execution user" /var/lib/tuptime + +# Note: +# systemd-sysusers doesn't create home directories. Use in combination with +# StateDirectory=tuptime under [Service] in tuptime.service unit. +# https://lists.freedesktop.org/archives/systemd-devel/2018-February/040348.html diff --git a/src/systemd/tuptime.sysusers b/src/systemd/tuptime.sysusers deleted file mode 100644 index a2cfeb0..0000000 --- a/src/systemd/tuptime.sysusers +++ /dev/null @@ -1,12 +0,0 @@ -u _tuptime - "Tuptime execution user" /var/lib/tuptime - - -# Note: -# -# systemd-sysusers doesn't create home directories, choose one workaround: -# A - Use in combination with tmpfiles.d (preferred) -# copy tuptime/src/systemd/tuptime-tmpfiles.conf to /lib/tmpfiles.d/ -# B - Set 'StateDirectory=tuptime' under [Service] in tuptime.service systemd unit file -# -# https://lists.freedesktop.org/archives/systemd-devel/2018-February/040330.html -# https://lists.freedesktop.org/archives/systemd-devel/2018-February/040348.html diff --git a/tuptime-install.sh b/tuptime-install.sh index f1a5ef4..91388e6 100644 --- a/tuptime-install.sh +++ b/tuptime-install.sh @@ -121,7 +121,7 @@ echo ' [OK]' echo "+ Creating Tuptime execution user '_tuptime'" if systemd-sysusers --version > /dev/null 2>&1; then echo " ...using systemd-sysusers" - install -m 644 "${F_TMP1}"/src/systemd/tuptime.sysusers /usr/lib/sysusers.d/tuptime.conf + install -m 644 "${F_TMP1}"/src/systemd/sysusers.d/tuptime.conf /usr/lib/sysusers.d/ ((SELX)) && restorecon -vF /usr/lib/sysusers.d/tuptime.conf systemd-sysusers /usr/lib/sysusers.d/tuptime.conf echo ' [OK]'