Bug#770281: dh-systemd: dh_systemd_enable --no-enable not working as expected

Noah Meyerhans noahm at debian.org
Thu Nov 20 07:22:17 GMT 2014


Package: dh-systemd
Severity: important

The spamassassin package contains spamd, a daemonized version of
spamassassin. This daemon is not enabled by default. In sysvinit, this
was accomplished in the init script using variables defined in
/etc/default/spamassassin. In systemd, this should be accomplished by
the use of "dh_systemd_enable --no-enable" in debian/rules. It's my
expectation that this is sufficient to install the unit file but leave
it disabled until the user explicitly enables it. However, this
doesn't seem to be working. "apt-get install spamassassin" results in
spamd getting started silently, with no output to indicate this. Details
are below and in the attached transcript.

Severity is set to important, but I think there may be justification to
raise it. Enabling daemons unexpectedly has likely security implications
and definitely violates expected/documented behavior.

The debian/rules file is at
http://anonscm.debian.org/viewvc/collab-maint/deb-maint/spamassassin/trunk/debian/rules?revision=25373&view=markup

The relevant lines from journalctl -xn:

Nov 19 22:07:06 jessie systemd[1]: Started Perl-based spam filter using text ana
-- Subject: Unit spamassassin.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit spamassassin.service has finished starting up.
-- 
-- The start-up result is done.
Nov 19 22:07:06 jessie su[5996]: Successful su for debian-spamd by root
Nov 19 22:07:06 jessie su[5996]: + /dev/pts/0 root:debian-spamd

and systemctl status -l spamassassin:

root at jessie:~# systemctl status -l spamassassin
● spamassassin.service - Perl-based spam filter using text analysis
   Loaded: loaded (/lib/systemd/system/spamassassin.service; disabled)
   Active: active (running) since Wed 2014-11-19 22:07:06 PST; 15min ago
  Process: 5989 ExecStart=/usr/sbin/spamd -d --pidfile=/var/run/spamassassin.pid $OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 5991 (/usr/sbin/spamd)
   CGroup: /system.slice/spamassassin.service
           ├─5991 /usr/sbin/spamd -d --pidfile=/var/run/spamassassin.pid --create-prefs --max-children 5 --helper-home-di
           ├─5992 spamd chil
           └─5993 spamd chil

Nov 19 22:07:01 jessie spamd[5989]: logger: removing stderr method
Nov 19 22:07:04 jessie spamd[5991]: spamd: server started on IO::Socket::IP [127.0.0.1]:783, IO::Socket::IP [::1]:783 (running version 3.4.0)
Nov 19 22:07:04 jessie spamd[5991]: spamd: server pid: 5991
Nov 19 22:07:04 jessie spamd[5991]: spamd: server successfully spawned child process, pid 5992
Nov 19 22:07:04 jessie spamd[5991]: spamd: server successfully spawned child process, pid 5993
Nov 19 22:07:04 jessie spamd[5991]: prefork: child states: IS
Nov 19 22:07:04 jessie spamd[5991]: prefork: child states: II
Nov 19 22:07:06 jessie systemd[1]: Started Perl-based spam filter using text analysis.


Thanks
noah

-- System Information:
Debian Release: jessie/sid
  APT prefers testing-updates
  APT policy: (500, 'testing-updates'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

-------------- next part --------------
root at jessie:~# systemctl list-units | grep spam
root at jessie:~# apt-get install spamassassin
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  binutils cpp cpp-4.9 gcc gcc-4.9 libasan1 libatomic1 libc-dev-bin libc6-dev
  libcilkrts5 libcloog-isl4 libdigest-hmac-perl liberror-perl libgcc-4.9-dev
  libgomp1 libio-socket-inet6-perl libisl10 libitm1 liblsan0 libmail-spf-perl
  libmpc3 libmpfr4 libnet-dns-perl libnet-ip-perl libnetaddr-ip-perl
  libquadmath0 libsocket6-perl libsys-hostname-long-perl libtsan0 libubsan0
  linux-libc-dev manpages-dev re2c sa-compile spamc
Suggested packages:
  binutils-doc cpp-doc gcc-4.9-locales gcc-multilib autoconf automake libtool
  flex bison gdb gcc-doc gcc-4.9-multilib gcc-4.9-doc libgcc1-dbg libgomp1-dbg
  libitm1-dbg libatomic1-dbg libasan1-dbg liblsan0-dbg libtsan0-dbg
  libubsan0-dbg libcilkrts5-dbg libquadmath0-dbg glibc-doc razor libdbi-perl
  pyzor libmail-dkim-perl
The following NEW packages will be installed:
  binutils cpp cpp-4.9 gcc gcc-4.9 libasan1 libatomic1 libc-dev-bin libc6-dev
  libcilkrts5 libcloog-isl4 libdigest-hmac-perl liberror-perl libgcc-4.9-dev
  libgomp1 libio-socket-inet6-perl libisl10 libitm1 liblsan0 libmail-spf-perl
  libmpc3 libmpfr4 libnet-dns-perl libnet-ip-perl libnetaddr-ip-perl
  libquadmath0 libsocket6-perl libsys-hostname-long-perl libtsan0 libubsan0
  linux-libc-dev manpages-dev re2c sa-compile spamassassin spamc
0 upgraded, 36 newly installed, 0 to remove and 0 not upgraded.
Need to get 25.1 MB of archives.
After this operation, 94.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://http.debian.net/debian/ jessie/main libasan1 amd64 4.9.1-19 [195 kB]
Get:2 http://http.debian.net/debian/ jessie/main libatomic1 amd64 4.9.1-19 [9,004 B]
Get:3 http://http.debian.net/debian/ jessie/main libcilkrts5 amd64 4.9.1-19 [40.1 kB]
Get:4 http://http.debian.net/debian/ jessie/main libisl10 amd64 0.12.2-2 [440 kB]
Get:5 http://http.debian.net/debian/ jessie/main libcloog-isl4 amd64 0.18.2-1 [59.4 kB]
Get:6 http://http.debian.net/debian/ jessie/main libgomp1 amd64 4.9.1-19 [37.8 kB]
Get:7 http://http.debian.net/debian/ jessie/main libitm1 amd64 4.9.1-19 [29.2 kB]
Get:8 http://http.debian.net/debian/ jessie/main liblsan0 amd64 4.9.1-19 [92.7 kB]
Get:9 http://http.debian.net/debian/ jessie/main libmpfr4 amd64 3.1.2-1 [516 kB]
Get:10 http://http.debian.net/debian/ jessie/main libquadmath0 amd64 4.9.1-19 [129 kB]
Get:11 http://http.debian.net/debian/ jessie/main libtsan0 amd64 4.9.1-19 [213 kB]
Get:12 http://http.debian.net/debian/ jessie/main libubsan0 amd64 4.9.1-19 [82.5 kB]
Get:13 http://http.debian.net/debian/ jessie/main libmpc3 amd64 1.0.2-1 [39.3 kB]
Get:14 http://http.debian.net/debian/ jessie/main binutils amd64 2.24.90.20141023-1 [3,334 kB]
Get:15 http://http.debian.net/debian/ jessie/main cpp-4.9 amd64 4.9.1-19 [5,166 kB]
Get:16 http://http.debian.net/debian/ jessie/main libgcc-4.9-dev amd64 4.9.1-19 [2,067 kB]
Get:17 http://http.debian.net/debian/ jessie/main gcc amd64 4:4.9.1-5 [5,112 B]
Get:18 http://http.debian.net/debian/ jessie/main libc-dev-bin amd64 2.19-13 [236 kB]
Get:19 http://http.debian.net/debian/ jessie/main libsocket6-perl amd64 0.25-1+b1 [28.5 kB]
Get:20 http://http.debian.net/debian/ jessie/main libio-socket-inet6-perl all 2.72-1 [16.6 kB]
Get:21 http://http.debian.net/debian/ jessie/main libnet-dns-perl amd64 0.81-1 [330 kB]
Get:22 http://http.debian.net/debian/ jessie/main libnetaddr-ip-perl amd64 4.075+dfsg-1+b1 [107 kB]
Get:23 http://http.debian.net/debian/ jessie/main libmail-spf-perl all 2.9.0-3 [120 kB]
Get:24 http://http.debian.net/debian/ jessie/main cpp amd64 4:4.9.1-5 [17.2 kB]
Get:25 http://http.debian.net/debian/ jessie/main gcc-4.9 amd64 4.9.1-19 [5,348 kB]
Get:26 http://http.debian.net/debian/ jessie/main linux-libc-dev amd64 3.16.7-2 [970 kB]
Get:27 http://http.debian.net/debian/ jessie/main libc6-dev amd64 2.19-13 [1,998 kB]
Get:28 http://http.debian.net/debian/ jessie/main libdigest-hmac-perl all 1.03+dfsg-1 [12.3 kB]
Get:29 http://http.debian.net/debian/ jessie/main liberror-perl all 0.17-1.1 [22.4 kB]
Get:30 http://http.debian.net/debian/ jessie/main libnet-ip-perl all 1.26-1 [33.2 kB]
Get:31 http://http.debian.net/debian/ jessie/main libsys-hostname-long-perl all 1.4-3 [11.6 kB]
Get:32 http://http.debian.net/debian/ jessie/main manpages-dev all 3.74-1 [1,865 kB]
Get:33 http://http.debian.net/debian/ jessie/main re2c amd64 0.13.5-1 [221 kB] 
Get:34 http://http.debian.net/debian/ jessie/main spamassassin all 3.4.0-3 [1,105 kB]
Get:35 http://http.debian.net/debian/ jessie/main sa-compile all 3.4.0-3 [87.6 kB]
Get:36 http://http.debian.net/debian/ jessie/main spamc amd64 3.4.0-3 [122 kB] 
Fetched 25.1 MB in 17s (1,405 kB/s)                                            
Extracting templates from packages: 100%
Selecting previously unselected package libasan1:amd64.
(Reading database ... 29785 files and directories currently installed.)
Preparing to unpack .../libasan1_4.9.1-19_amd64.deb ...
Unpacking libasan1:amd64 (4.9.1-19) ...
Selecting previously unselected package libatomic1:amd64.
Preparing to unpack .../libatomic1_4.9.1-19_amd64.deb ...
Unpacking libatomic1:amd64 (4.9.1-19) ...
Selecting previously unselected package libcilkrts5:amd64.
Preparing to unpack .../libcilkrts5_4.9.1-19_amd64.deb ...
Unpacking libcilkrts5:amd64 (4.9.1-19) ...
Selecting previously unselected package libisl10:amd64.
Preparing to unpack .../libisl10_0.12.2-2_amd64.deb ...
Unpacking libisl10:amd64 (0.12.2-2) ...
Selecting previously unselected package libcloog-isl4:amd64.
Preparing to unpack .../libcloog-isl4_0.18.2-1_amd64.deb ...
Unpacking libcloog-isl4:amd64 (0.18.2-1) ...
Selecting previously unselected package libgomp1:amd64.
Preparing to unpack .../libgomp1_4.9.1-19_amd64.deb ...
Unpacking libgomp1:amd64 (4.9.1-19) ...
Selecting previously unselected package libitm1:amd64.
Preparing to unpack .../libitm1_4.9.1-19_amd64.deb ...
Unpacking libitm1:amd64 (4.9.1-19) ...
Selecting previously unselected package liblsan0:amd64.
Preparing to unpack .../liblsan0_4.9.1-19_amd64.deb ...
Unpacking liblsan0:amd64 (4.9.1-19) ...
Selecting previously unselected package libmpfr4:amd64.
Preparing to unpack .../libmpfr4_3.1.2-1_amd64.deb ...
Unpacking libmpfr4:amd64 (3.1.2-1) ...
Selecting previously unselected package libquadmath0:amd64.
Preparing to unpack .../libquadmath0_4.9.1-19_amd64.deb ...
Unpacking libquadmath0:amd64 (4.9.1-19) ...
Selecting previously unselected package libtsan0:amd64.
Preparing to unpack .../libtsan0_4.9.1-19_amd64.deb ...
Unpacking libtsan0:amd64 (4.9.1-19) ...
Selecting previously unselected package libubsan0:amd64.
Preparing to unpack .../libubsan0_4.9.1-19_amd64.deb ...
Unpacking libubsan0:amd64 (4.9.1-19) ...
Selecting previously unselected package libmpc3:amd64.
Preparing to unpack .../libmpc3_1.0.2-1_amd64.deb ...
Unpacking libmpc3:amd64 (1.0.2-1) ...
Selecting previously unselected package binutils.
Preparing to unpack .../binutils_2.24.90.20141023-1_amd64.deb ...
Unpacking binutils (2.24.90.20141023-1) ...
Selecting previously unselected package cpp-4.9.
Preparing to unpack .../cpp-4.9_4.9.1-19_amd64.deb ...
Unpacking cpp-4.9 (4.9.1-19) ...
Selecting previously unselected package cpp.
Preparing to unpack .../cpp_4%3a4.9.1-5_amd64.deb ...
Unpacking cpp (4:4.9.1-5) ...
Selecting previously unselected package libgcc-4.9-dev:amd64.
Preparing to unpack .../libgcc-4.9-dev_4.9.1-19_amd64.deb ...
Unpacking libgcc-4.9-dev:amd64 (4.9.1-19) ...
Selecting previously unselected package gcc-4.9.
Preparing to unpack .../gcc-4.9_4.9.1-19_amd64.deb ...
Unpacking gcc-4.9 (4.9.1-19) ...
Selecting previously unselected package gcc.
Preparing to unpack .../gcc_4%3a4.9.1-5_amd64.deb ...
Unpacking gcc (4:4.9.1-5) ...
Selecting previously unselected package libc-dev-bin.
Preparing to unpack .../libc-dev-bin_2.19-13_amd64.deb ...
Unpacking libc-dev-bin (2.19-13) ...
Selecting previously unselected package linux-libc-dev:amd64.
Preparing to unpack .../linux-libc-dev_3.16.7-2_amd64.deb ...
Unpacking linux-libc-dev:amd64 (3.16.7-2) ...
Selecting previously unselected package libc6-dev:amd64.
Preparing to unpack .../libc6-dev_2.19-13_amd64.deb ...
Unpacking libc6-dev:amd64 (2.19-13) ...
Selecting previously unselected package libdigest-hmac-perl.
Preparing to unpack .../libdigest-hmac-perl_1.03+dfsg-1_all.deb ...
Unpacking libdigest-hmac-perl (1.03+dfsg-1) ...
Selecting previously unselected package liberror-perl.
Preparing to unpack .../liberror-perl_0.17-1.1_all.deb ...
Unpacking liberror-perl (0.17-1.1) ...
Selecting previously unselected package libsocket6-perl.
Preparing to unpack .../libsocket6-perl_0.25-1+b1_amd64.deb ...
Unpacking libsocket6-perl (0.25-1+b1) ...
Selecting previously unselected package libio-socket-inet6-perl.
Preparing to unpack .../libio-socket-inet6-perl_2.72-1_all.deb ...
Unpacking libio-socket-inet6-perl (2.72-1) ...
Selecting previously unselected package libnet-ip-perl.
Preparing to unpack .../libnet-ip-perl_1.26-1_all.deb ...
Unpacking libnet-ip-perl (1.26-1) ...
Selecting previously unselected package libnet-dns-perl.
Preparing to unpack .../libnet-dns-perl_0.81-1_amd64.deb ...
Unpacking libnet-dns-perl (0.81-1) ...
Selecting previously unselected package libnetaddr-ip-perl.
Preparing to unpack .../libnetaddr-ip-perl_4.075+dfsg-1+b1_amd64.deb ...
Unpacking libnetaddr-ip-perl (4.075+dfsg-1+b1) ...
Selecting previously unselected package libmail-spf-perl.
Preparing to unpack .../libmail-spf-perl_2.9.0-3_all.deb ...
Unpacking libmail-spf-perl (2.9.0-3) ...
Selecting previously unselected package libsys-hostname-long-perl.
Preparing to unpack .../libsys-hostname-long-perl_1.4-3_all.deb ...
Unpacking libsys-hostname-long-perl (1.4-3) ...
Selecting previously unselected package manpages-dev.
Preparing to unpack .../manpages-dev_3.74-1_all.deb ...
Unpacking manpages-dev (3.74-1) ...
Selecting previously unselected package re2c.
Preparing to unpack .../re2c_0.13.5-1_amd64.deb ...
Unpacking re2c (0.13.5-1) ...
Selecting previously unselected package spamassassin.
Preparing to unpack .../spamassassin_3.4.0-3_all.deb ...
Unpacking spamassassin (3.4.0-3) ...
Selecting previously unselected package sa-compile.
Preparing to unpack .../sa-compile_3.4.0-3_all.deb ...
Unpacking sa-compile (3.4.0-3) ...
Selecting previously unselected package spamc.
Preparing to unpack .../spamc_3.4.0-3_amd64.deb ...
Unpacking spamc (3.4.0-3) ...
Processing triggers for man-db (2.7.0.2-3) ...
Setting up libasan1:amd64 (4.9.1-19) ...
Setting up libatomic1:amd64 (4.9.1-19) ...
Setting up libcilkrts5:amd64 (4.9.1-19) ...
Setting up libisl10:amd64 (0.12.2-2) ...
Setting up libcloog-isl4:amd64 (0.18.2-1) ...
Setting up libgomp1:amd64 (4.9.1-19) ...
Setting up libitm1:amd64 (4.9.1-19) ...
Setting up liblsan0:amd64 (4.9.1-19) ...
Setting up libmpfr4:amd64 (3.1.2-1) ...
Setting up libquadmath0:amd64 (4.9.1-19) ...
Setting up libtsan0:amd64 (4.9.1-19) ...
Setting up libubsan0:amd64 (4.9.1-19) ...
Setting up libmpc3:amd64 (1.0.2-1) ...
Setting up binutils (2.24.90.20141023-1) ...
Setting up cpp-4.9 (4.9.1-19) ...
Setting up cpp (4:4.9.1-5) ...
Setting up libgcc-4.9-dev:amd64 (4.9.1-19) ...
Setting up gcc-4.9 (4.9.1-19) ...
Setting up gcc (4:4.9.1-5) ...
Setting up libc-dev-bin (2.19-13) ...
Setting up linux-libc-dev:amd64 (3.16.7-2) ...
Setting up libc6-dev:amd64 (2.19-13) ...
Setting up libdigest-hmac-perl (1.03+dfsg-1) ...
Setting up liberror-perl (0.17-1.1) ...
Setting up libsocket6-perl (0.25-1+b1) ...
Setting up libio-socket-inet6-perl (2.72-1) ...
Setting up libnet-ip-perl (1.26-1) ...
Setting up libnet-dns-perl (0.81-1) ...
Setting up libnetaddr-ip-perl (4.075+dfsg-1+b1) ...
Setting up libmail-spf-perl (2.9.0-3) ...
Setting up libsys-hostname-long-perl (1.4-3) ...
Setting up manpages-dev (3.74-1) ...
Setting up re2c (0.13.5-1) ...
Setting up spamassassin (3.4.0-3) ...
Adding system user `debian-spamd' (UID 107) ...
Adding new group `debian-spamd' (GID 113) ...
Adding new user `debian-spamd' (UID 107) with group `debian-spamd' ...
Creating home directory `/var/lib/spamassassin' ...
Setting up sa-compile (3.4.0-3) ...
Running sa-compile (may take a long time)
Setting up spamc (3.4.0-3) ...
Processing triggers for libc-bin (2.19-13) ...
root at jessie:~# systemctl list-units | grep spam
spamassassin.service                                                                     loaded active running   Perl-based spam filter using text analysis
root at jessie:~# ps auxww|grep spam
root      5991  1.9  2.2 138792  2632 ?        Ss   22:07   0:00 /usr/sbin/spamd -d --pidfile=/var/run/spamassassin.pid --create-prefs --max-children 5 --helper-home-dir
root      5992  0.0  0.1 138792   204 ?        S    22:07   0:00 spamd child
root      5993  0.0  0.1 138792   208 ?        S    22:07   0:00 spamd child
root      6677  0.0  1.6  12716  1968 ttyS0    S+   22:07   0:00 grep spam
root at jessie:~# 


More information about the Pkg-systemd-maintainers mailing list