Bug#976427: plocate: Please keep cron script for use without systemd

2020-12-05 Thread GSR
Package: plocate
Version: 1.1.1-1
Tags: patch

Hi,
se...@debian.org (2020-12-05 at 0032.04 +0100):
> The cron script did the wrong thing from 1.1.0:
> 
>  - It depended on mlocate's database.
>  - It would do double-work on top of the systemd timer.

As mlocate is also installed here, it went without issues.

> I'm happy taking a patch to add back a script that fixes both of these
> issues, ie., runs updatedb.plocate instead of plocate-build, and does not run
> if the systemd timer would run instead. Would you like to contribute one?

Changing mlocate script to work with plocate was easy, so it does all
that and more. See attached file.

Cheers,
GSR
 
#! /bin/bash

set -e

UPDATEDB=/usr/sbin/updatedb.plocate

# skip in favour of systemd timer
if [ -d /run/systemd/system ]; then
exit 0
fi

[ -x $UPDATEDB ] || exit 0

if which on_ac_power >/dev/null 2>&1; then
ON_BATTERY=0
on_ac_power >/dev/null 2>&1 || ON_BATTERY=$?
if [ "$ON_BATTERY" -eq 1 ]; then
exit 0
fi
fi

# See ionice(1)
IONICE=
if [ -x /usr/bin/ionice ] &&
/usr/bin/ionice -c3 true 2>/dev/null; then
IONICE="/usr/bin/ionice -c3"
fi

# See nocache(1)
NOCACHE=
if [ -x /usr/bin/nocache ]; then
NOCACHE="/usr/bin/nocache"
fi

# It can open many files at once, ensure a big limit
ulimit -n 1048576

flock --nonblock /run/plocate.daily.lock $NOCACHE $IONICE nice $UPDATEDB


Bug#976427: plocate: Please keep cron script for use without systemd

2020-12-04 Thread Steinar H. Gunderson
On Sat, Dec 05, 2020 at 12:18:26AM +0100, GSR wrote:
> Last update removed cron script, which was working OK. Not everyone
> uses systemd timers, so please keep the script.

Hi,

The cron script did the wrong thing from 1.1.0:

 - It depended on mlocate's database.
 - It would do double-work on top of the systemd timer.

I'm happy taking a patch to add back a script that fixes both of these
issues, ie., runs updatedb.plocate instead of plocate-build, and does not run
if the systemd timer would run instead. Would you like to contribute one?

/* Steinar */
-- 
Homepage: https://www.sesse.net/



Bug#976427: plocate: Please keep cron script for use without systemd

2020-12-04 Thread GSR
Package: plocate
Version: 1.1.0-4
Severity: normal

Dear Maintainer,

Last update removed cron script, which was working OK. Not everyone
uses systemd timers, so please keep the script.

Thank you,
GSR
 

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.9.0-1-amd64 (SMP w/8 CPU threads)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB:en
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled

Versions of packages plocate depends on:
ii  libc6   2.31-5
ii  libgcc-s1   10.2.0-23
ii  libstdc++6  10.2.0-23
ii  liburing1   0.7-1
ii  libzstd11.4.5+dfsg-2

plocate recommends no packages.

plocate suggests no packages.

-- no debconf information