chown: `qscand': invalid user after qmail-scanner removal

Forum for getting help with Project Gamera, Spamassassin, Clamav, qmail-scanner and other anti-spam tools.
itbiz2
Forum User
Forum User
Posts: 10
Joined: Tue Jun 18, 2013 7:59 pm
Location: United States

chown: `qscand': invalid user after qmail-scanner removal

Unread post by itbiz2 »

I installed clamAV from the atomic repo and qmail-scanner. I just removed qmail-scanner because it was causing issues due to spamassassian. Now when /etc/cron.hourly/freshclam runs it gives the error in the subject. I would like clamAV to update still and run monthly scans, can anyone let me know how to resolve this issue?
prupert
Forum Regular
Forum Regular
Posts: 573
Joined: Tue Aug 01, 2006 2:45 pm
Location: Netherlands

Re: chown: `qscand': invalid user after qmail-scanner remova

Unread post by prupert »

Change 'DatabaseOwner' in /etc/freshclam.conf from 'qscand' to 'root' or the ClamAV user, depending on your setup.
You might also want to change the 'User' setting in /etc/clamd.conf.
Lemonbit Internet Dedicated Server Management
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Re: chown: `qscand': invalid user after qmail-scanner remova

Unread post by faris »

default to use is clamav if you don't use root (which you need to id you use the ASL clamav<>FTP stuff).

You'll also need to manually run /etc/cron.hourly/freshclam (or just wait an hour) to get the logfile and signature files owned by the same user you specify.

The issue is that when you install qmail-scanner, a user qscand is created and it is that user that is set as the default db owner in freshclam.conf and user in clamd.conf. When you remove qmail-scanner, user qscand is removed, but the conf files are not changed. The hourly freshclam cronjob then tries to chown the logfile and the signature (database) files to qscand but this user doesn't exist anymore, hence the error you get.
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
itbiz2
Forum User
Forum User
Posts: 10
Joined: Tue Jun 18, 2013 7:59 pm
Location: United States

Re: chown: `qscand': invalid user after qmail-scanner remova

Unread post by itbiz2 »

I changed /etc/freshclam.conf to DatabaseOwner clamav and it is still doing the same thing. /etc/clamd.conf has the user set as clamav so it seems like it should work, not sure where it is still getting that user from.

GNU nano 1.3.12 File: /etc/cron.hourly/freshclam

#!/bin/sh

### A simple update script for the clamav virus database.
### This could as well be replaced by a SysV script.

### fix log file if needed
LOG_FILE="/var/log/clamav/freshclam.log"
USER=`awk '/DatabaseOwner/ {print $2}' /etc/freshclam.conf`
if [ ! -f "$LOG_FILE" ]; then
touch "$LOG_FILE"
chmod 644 "$LOG_FILE"
chown $USER.$USER "$LOG_FILE"
fi

# User check event
chown -R $USER.$USER /var/clamav

/usr/bin/freshclam \
--quiet \
--datadir="/var/clamav" \
--log="$LOG_FILE" \
--verbose \
--daemon-notify="/etc/clamd.conf" 2>/dev/null



# Current 3rd party channel updater
#if [ -x /usr/bin/clamav_updater.sh ]; then
# /usr/bin/clamav_updater.sh >/dev/null 2>&1
#fi
prupert
Forum Regular
Forum Regular
Posts: 573
Joined: Tue Aug 01, 2006 2:45 pm
Location: Netherlands

Re: chown: `qscand': invalid user after qmail-scanner remova

Unread post by prupert »

What is the exact error if you run "/etc/cron.hourly/freshclam"?
Lemonbit Internet Dedicated Server Management
itbiz2
Forum User
Forum User
Posts: 10
Joined: Tue Jun 18, 2013 7:59 pm
Location: United States

Re: chown: `qscand': invalid user after qmail-scanner remova

Unread post by itbiz2 »

prupert wrote:What is the exact error if you run "/etc/cron.hourly/freshclam"?
chown: `qscand': invalid user
Post Reply