diff options
Diffstat (limited to 'init')
-rw-r--r-- | init/systemd/Makefile.am | 14 | ||||
-rw-r--r-- | init/systemd/man-db.service.in | 16 | ||||
-rw-r--r-- | init/systemd/man-db.timer | 11 |
3 files changed, 39 insertions, 2 deletions
diff --git a/init/systemd/Makefile.am b/init/systemd/Makefile.am index a79caf10..67397b58 100644 --- a/init/systemd/Makefile.am +++ b/init/systemd/Makefile.am @@ -18,11 +18,21 @@ ## along with man-db; if not, write to the Free Software Foundation, ## Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -EXTRA_DIST = man-db.conf.in +EXTRA_DIST = \ + man-db.conf.in \ + man-db.service.in -CLEANFILES = man-db.conf +CLEANFILES = \ + man-db.conf \ + man-db.service nodist_systemdtmpfiles_DATA = man-db.conf +systemdsystemunit_DATA = man-db.timer +nodist_systemdsystemunit_DATA = man-db.service + man-db.conf: man-db.conf.in sed -e "s,[@]cache_top_owner[@],$(cache_top_owner),g" $< > $@ + +man-db.service: man-db.service.in + sed -e "s,[@]bindir[@],$(bindir),g" $< > $@ diff --git a/init/systemd/man-db.service.in b/init/systemd/man-db.service.in new file mode 100644 index 00000000..ba66585f --- /dev/null +++ b/init/systemd/man-db.service.in @@ -0,0 +1,16 @@ +[Unit] +Description=Daily man-db regeneration +Documentation=man:mandb(8) +ConditionACPower=true + +[Service] +Type=oneshot +ExecStart=+/usr/bin/install -d -o man -g man -m 0755 /var/cache/man +# Expunge old catman pages which have not been read in a week. +ExecStart=/usr/bin/find /var/cache/man -type f -name *.gz -atime +6 -delete +# Regenerate man database. +ExecStart=@bindir@/mandb +User=man +Nice=19 +IOSchedulingClass=idle +IOSchedulingPriority=7 diff --git a/init/systemd/man-db.timer b/init/systemd/man-db.timer new file mode 100644 index 00000000..b0f7964b --- /dev/null +++ b/init/systemd/man-db.timer @@ -0,0 +1,11 @@ +[Unit] +Description=Daily man-db regeneration +Documentation=man:mandb(8) + +[Timer] +OnCalendar=daily +AccuracySec=12h +Persistent=true + +[Install] +WantedBy=timers.target |