Bug#887847: Extra quoting needed for the job description

Yuri D'Elia wavexx at thregr.org
Sat Jan 20 15:49:12 GMT 2018


Package: systemd-cron
Version: 1.5.12-2
Severity: normal

Found this in the wild: zfsutils-linux package has the following cron.d entry:

> # Scrub the second Sunday of every month.
> 24 0 8-14 * * root [ $(date +\%w) -eq 0 ] && [ -x /usr/lib/zfs-linux/scrub ] && /usr/lib/zfs-linux/scrub

generating this timer unit:

> [Unit]
> Description=[Timer] "24 0 8-14 * * root [ $(date +\%w) -eq 0 ] && [ -x /usr/lib/zfs-linux/scrub ] && /usr/lib/zfs-linux/scrub"

which yields:

/run/systemd/generator/cron-zfsutils-linux-root-0.timer:2: Failed to resolve unit specifiers on [Timer] "24 0 8-14 * * root [ $(date +\%w) -eq 0 ] && [ -x /usr/lib/zfs-linux/scrub ] && /usr/lib/zfs-linux/scrub", ignoring: Invalid slot

The % should be escaped in Description as well using %%.

-- Package-specific info:
-- output of systemd-delta

-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (900, 'unstable'), (800, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.14.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages systemd-cron depends on:
ii  libc6         2.26-4
ii  python3       3.6.4-1
ii  systemd-sysv  236-3

Versions of packages systemd-cron recommends:
ii  exim4-daemon-light [mail-transport-agent]  4.90-3

systemd-cron suggests no packages.



More information about the Pkg-systemd-maintainers mailing list