Bug 6430 - sa-update cron script gives error messages near pidof usage
Summary: sa-update cron script gives error messages near pidof usage
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 2
Hardware: i586 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact:
URL:
Whiteboard: MGA2-32-OK MGA2-64-OK
Keywords: validated_update
Depends on:
Blocks: 5959
  Show dependency treegraph
 
Reported: 2012-06-12 13:00 CEST by Zoltan Balaton
Modified: 2012-08-02 23:01 CEST (History)
5 users (show)

See Also:
Source RPM: spamassassin-3.3.2-9.mga2.src.rpm
CVE:
Status comment:


Attachments

Description Zoltan Balaton 2012-06-12 13:00:15 CEST
I'm seeing this:

 /etc/cron.daily/sa-update:
ERROR: spamd did not start...
run-parts: /etc/cron.daily/sa-update exited with return code 1

This seems to come from this part of the script:
84         # verify it's running
85         SA_PID=`pidof spamd`
86         if [ -z "$SA_PID" ]; then
87             echo "ERROR: spamd did not start..."

And indeed pidof does not return the correct pid even though spamd is running:
$ ps axf | grep spamd
27042 pts/0    S+     0:00              \_ grep --color spamd
26227 ?        Ss     0:10 /usr/bin/spamd --pidfile /var/run/spamd.pid -d -c -m5 -H --syslog=/var/log/spamassassin/spamd.log --socketpath=/var/run/spamd/spamd.socket
26234 ?        S      0:00  \_ spamd child
26235 ?        S      0:00  \_ spamd child
$ pidof spamd
$ echo $?
1

strace shows:
...
open("26227/stat", O_RDONLY)            = 4
fstat64(4, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7776000
read(4, "26227 (/usr/bin/spamd ) S 1 2622"..., 1024) = 248
close(4)                                = 0
munmap(0xb7776000, 4096)                = 0
open("26227/cmdline", O_RDONLY)         = 4
fstat64(4, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7776000
read(4, "/usr/bin/spamd --pidfile /var/ru"..., 1024) = 138
read(4, "", 1024)                       = 0
read(4, "", 1024)                       = 0
close(4)                                = 0
munmap(0xb7776000, 4096)                = 0
readlink("/proc/26227/exe", "/usr/bin/perl5.14.2", 4096) = 19
open("26234/stat", O_RDONLY)            = 4
fstat64(4, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7776000
read(4, "26234 (spamd child) S 26227 2622"..., 1024) = 242
close(4)                                = 0
munmap(0xb7776000, 4096)                = 0
open("26234/cmdline", O_RDONLY)         = 4
fstat64(4, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7776000
read(4, "spamd child", 1024)            = 11
read(4, "", 1024)                       = 0
read(4, "", 1024)                       = 0
close(4)                                = 0
munmap(0xb7776000, 4096)                = 0  
readlink("/proc/26234/exe", "/usr/bin/perl5.14.2", 4096) = 19
open("26235/stat", O_RDONLY)            = 4
fstat64(4, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7776000
read(4, "26235 (spamd child) S 26227 2622"..., 1024) = 242
close(4)                                = 0  
munmap(0xb7776000, 4096)                = 0
open("26235/cmdline", O_RDONLY)         = 4
fstat64(4, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7776000
read(4, "spamd child", 1024)            = 11
read(4, "", 1024)                       = 0
read(4, "", 1024)                       = 0
close(4)                                = 0
munmap(0xb7776000, 4096)                = 0
readlink("/proc/26235/exe", "/usr/bin/perl5.14.2", 4096) = 19
...
Comment 1 Manuel Hiebel 2012-06-17 16:39:23 CEST
Rémmy, something for you ?

Assignee: bugsquad => remco

Remco Rijnders 2012-06-17 16:43:34 CEST

Status: NEW => ASSIGNED

Remco Rijnders 2012-06-22 07:13:58 CEST

See Also: (none) => https://bugzilla.redhat.com/show_bug.cgi?id=755644
Source RPM: spamassassin-3.3.2-9.mga2.src.rpm sysvinit-legacy-2.87-17.mga2.src.rpm => spamassassin-3.3.2-9.mga2.src.rpm

Comment 2 Remco Rijnders 2012-06-22 07:37:17 CEST
Hi Zoltan,

Thank you for the report. I believe the problem is similar / identical to the one reported in the indicated redhat bug report. Fortunately, so is the solution.

QA, I have made an updated package available in 2/updates_testing (spamassassin-3.3.2-10.mga2). Can you please test it?

CC: (none) => remco
Assignee: remco => qa-bugs

Manuel Hiebel 2012-06-22 13:33:37 CEST

Blocks: (none) => 5959

Comment 3 Zoltan Balaton 2012-06-24 11:59:20 CEST
I've installed the 3.3.2-10 package and I don't see the error now but the files in /var/lib/spamassassin haven't been updated since so I'm waiting for an update to happen to tell for sure that it's working correctly. (It should work as it's a simple fix but if you want it to be tested...)
Comment 4 Dave Hodgins 2012-07-04 04:56:53 CEST
I've just installed spamassassin-spamd on a Mageia 2 i586 system.

It updated during the install.  I'll also wait for an update before confirming
it's ok.

CC: (none) => davidwhodgins

Comment 5 Zoltan Balaton 2012-07-04 09:41:54 CEST
Updates seem to work for me on mga2 i586. Could someone do testing on x86_64 please.

Whiteboard: (none) => MGA2-32-OK

Comment 6 Samuel Verschelde 2012-07-23 18:33:38 CEST
This update addresses bug #5959 too. A new dependency was added, so bug #2317 will probably play a role.

CC: (none) => stormi

Comment 7 Samuel Verschelde 2012-08-01 17:52:19 CEST
I had no problem with the previous version but I can confirm that the new one downloads updates correctly.
Samuel Verschelde 2012-08-01 17:52:30 CEST

Whiteboard: MGA2-32-OK => MGA2-32-OK MGA2-64-OK?

Comment 8 Samuel Verschelde 2012-08-01 18:12:47 CEST
Tested on x86_64 with :
- spamassassin -D < /usr/share/doc/spamassassin/sample-spam.txt => check it changes the subject to "Subject: [SPAM] Test spam mail (GTUBE)"
- as root, sa-update -v (after having cleaned the contents of /var/lib/spamassassin to make sure it downloads updates: rm /var/lib/spamassassin/* -rf)

+ checked the added requires was there.

According to the depcheck script, the added requires to gnupg doesn't need linking to updates.

Update validated. See next comment from remmy (yes, I see in the future) for the advisory.

Package: spamassassin-3.3.2-10.mga2

Keywords: (none) => validated_update
CC: (none) => sysadmin-bugs
Whiteboard: MGA2-32-OK MGA2-64-OK? => MGA2-32-OK MGA2-64-OK

Comment 9 Remco Rijnders 2012-08-01 18:30:47 CEST
Advisory text:

This update provides a remedy for two reported problems with the spamassassin package:
- A missing requirement on gnupg has been added [1]
- A failed call to pidof could cause the sa-update script to exit unsuccessfully, resulting in updates failing to download properly. A workaround for this problem has been applied [2]

References:
1) https://bugs.mageia.org/show_bug.cgi?id=5959
2) https://bugs.mageia.org/show_bug.cgi?id=6430
Comment 10 Thomas Backlund 2012-08-02 23:01:09 CEST
Update pushed:
https://wiki.mageia.org/en/Support/Advisories/MGAA-2012-0146

Status: ASSIGNED => RESOLVED
CC: (none) => tmb
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.