clamd issues

Issues related to applications and software problems
portnoy
Posts: 6
Joined: 2015/09/14 11:49:29

clamd issues

Postby portnoy » 2017/09/01 17:19:01

I'd been running amavis/clam/postfix together fairly happily, but I updated clam via yum and the problems started. I think I have it figured out, as with other clam updates it's always a permissions thing - I have amavsid running as user/group clamav. Right now my problem is I have to start clamd before amavisd to make certain clamd.sock and clamd.pid get the correct owners - I'll try to figure that one out on my own - but when I start clamd I get the following errors:

Code: Select all

-bash: LogFile: command not found
-bash: LogFileMaxSize: command not found
-bash: LogTime: command not found
-bash: LogSyslog: command not found
-bash: PidFile: command not found
-bash: TemporaryDirectory: command not found
-bash: DatabaseDirectory: command not found
-bash: LocalSocket: command not found
-bash: LocalSocketGroup: command not found
-bash: FixStaleSocket: command not found
-bash: TCPSocket: command not found
-bash: TCPAddr: command not found
-bash: MaxConnectionQueueLength: command not found
-bash: MaxThreads: command not found
-bash: ReadTimeout: command not found
-bash: User: command not found
-bash: AllowSupplementaryGroups: command not found
-bash: ScanPE: command not found
-bash: ScanELF: command not found
-bash: DetectBrokenExecutables: command not found
-bash: ScanOLE2: command not found
-bash: ScanPDF: command not found
-bash: ScanXMLDOCS: command not found
-bash: ScanMail: command not found
-bash: PhishingSignatures: command not found
-bash: PhishingScanURLs: command not found
-bash: ScanArchive: command not found
-bash: ArchiveBlockEncrypted: command not found
-bash: Bytecode: command not found
-bash: BytecodeSecurity: command not found
[root@linux ~]#


I found the offending line in clamd init.d file:

Code: Select all

test -f /etc/clamd.conf && . /etc/clamd.conf


This actually was

Code: Select all

test -f /etc/sysconfig/clamd && . /etc/sysconfig/clamd


..but I am running centos 6 and there is no clamd in /etc/sysconfig, so I changed it to point to the actual config file.

I'm not certain what this is trying to accomplish other than see if /etc/clamd.conf is there and it's a file. I don't understand the " . /etc/clamd.conf" after the "&&". I realize I have other issues, and I'm attempting to resolve them with too much handholding, but if someone could explain that line in the clamd init file, I would appreciate it.

User avatar
avij
Forum Moderator
Posts: 2180
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: clamd issues

Postby avij » 2017/09/01 18:12:28

portnoy wrote:..but I am running centos 6 and there is no clamd in /etc/sysconfig, so I changed it to point to the actual config file.

You can fix the "command not found" errors above by reverting your change.

In essence, the ". /etc/sysconfig/clamd" means the script at /etc/sysconfig/clamd will be executed. Normally those sysconfig files set up a few environment variable. The /etc/clamd.conf file is not designed to be executed.

portnoy
Posts: 6
Joined: 2015/09/14 11:49:29

Re: clamd issues

Postby portnoy » 2017/09/02 18:36:53

The clamd install did not make a /etc/sysconfig/clamd config file, so I changed the clamd init to point to /etc/clamd.conf instead. Right now, the "test" line appears to be the only thing that's affected by that, so I'm hoping if I remove the " . /etched/clamd.conf" part of that line it won't hurt anything. Should I be looking to generate something in /etc/sysconfig instead?

User avatar
avij
Forum Moderator
Posts: 2180
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: clamd issues

Postby avij » 2017/09/02 19:39:06

No, the file in /etc/sysconfig is optional. You don't need to create that file.

As a reminder:
test -f /etc/sysconfig/clamd && . /etc/sysconfig/clamd

This means:
if /etc/sysconfig/clamd is a file and it exists, then load the /etc/sysconfig/clamd file.

portnoy
Posts: 6
Joined: 2015/09/14 11:49:29

Re: clamd issues

Postby portnoy » 2017/09/03 00:04:26

Got it. I didn't realize the 2nd part executed the config file, the space between the "." and the "/" confused me. Ill try to work out the rest of my issues on my own, but thanks for the help.

Whoever
Posts: 964
Joined: 2013/09/06 03:12:10

Re: clamd issues

Postby Whoever » 2017/09/03 04:42:15

portnoy wrote:Got it. I didn't realize the 2nd part executed the config file, the space between the "." and the "/" confused me. Ill try to work out the rest of my issues on my own, but thanks for the help.


it doesn't really execute the file, it "source"-es it. The difference is that when you source a file, the commands within the file are run in the current shell and not in a new shell.