Package: nsd
Version: 4.0.0-2
Severity: important

--- Please enter the report below this line. ---
Hi,

The systemd service file has some ExecStartPre to create PID and database directory. Those directives are wrong in two ways. First, every systemd directive should have a full path to the executable, e.g. /bin/mkdir and not just mkdir. Second, this command is NOT executed in a shell environment, so shell replacement such as $(command) don't work. The right way to achieve this is to call /bin/sh -c '$(command)'.
Attached is the fixed unit file.

By the way, "Type=simple" can be removed, since its the default, but I let it in the file, I don't want to mess with multiple fixes.

Adrien

--- System information. ---
Architecture: i386
Kernel: Linux 3.11-1-686-pae

Debian Release: jessie/sid
500 unstable ftp.fr.debian.org
1 experimental ftp.fr.debian.org

--- Package information. ---
Depends (Version) | Installed
======================-+-===========
nsd3 |


Package's Recommends field is empty.

Package's Suggests field is empty.
[Unit]
Description=Name Server Daemon
After=network.target

[Service]
Type=simple
Restart=always
Environment=CONFFILE=/etc/nsd/nsd.conf
ExecStartPre=/bin/sh -c '/bin/mkdir -p "$(dirname "$(/usr/sbin/nsd-checkconf -o 
pidfile $CONFFILE)")"'
ExecStartPre=/bin/sh -c '/bin/chown "$(/usr/sbin/nsd-checkconf -o username 
$CONFFILE)" "$(dirname "$(/usr/sbin/nsd-checkconf -o pidfile $CONFFILE)")"'
ExecStartPre=/bin/sh -c '/bin/mkdir -p "$(dirname "$(/usr/sbin/nsd-checkconf -o 
database $CONFFILE)")"'
ExecStartPre=/bin/sh -c '/bin/chown "$(/usr/sbin/nsd-checkconf -o username 
$CONFFILE)" "$(dirname "$(/usr/sbin/nsd-checkconf -o database $CONFFILE)")"'
ExecStart=/usr/sbin/nsd -d -c $CONFFILE
ExecReload=/usr/sbin/nsd-control reload

[Install]
WantedBy=multi-user.target

Reply via email to