Koozali.org: home of the SME Server

Error saving email changes - (clam restart failure)

Offline NickCritten

  • *
  • 245
  • +0/-0
Error saving email changes - (clam restart failure)
« on: November 08, 2004, 02:09:09 PM »
Hi everyone,

I've searched Contribs.org and googled this to death, but cannot find any answers..

When saving changes on the Email, or antivirus page, I get :

Operation status report
Error occurred while updating system configuration.

I checked the logs and found this:

Nov  8 12:42:16 apollo e-smith[5346]: Running event handler: /etc/e-smith/events/email-update/S65restart-clamd
Nov  8 12:42:16 apollo e-smith[5346]: /etc/rc.d/init.d/clamd: /etc/rc.d/init.d/clamd: /bin/sh: bad interpreter: Permission denied
Nov  8 12:42:16 apollo e-smith[5346]: /etc/rc.d/init.d/clamd: /etc/rc.d/init.d/clamd: /bin/sh: bad interpreter: Permission denied

The issue appears to be with the S65restart-clamd script.  I tried running the command manually and got the same error.  Has anyone seen this before / Knows how to fix this or can point me in the right direction?

I can workaround at the moment by rebooting, but its not the best solution. :)

Any help would be greatly apreciated.

System: 6.01
sme.swerts-knudsen.dk addons: spamfilter (SA), php4.3.8, antivirus (ClamAV)
...
Nick

"No good deed goes unpunished." :-x...

Offline byte

  • *
  • 2,183
  • +2/-0
Error saving email changes - (clam restart failure)
« Reply #1 on: November 08, 2004, 04:04:36 PM »
The only time i see this is when something has been edited in windows notepad then moved over to linux...

try running

perl -p -i -e "s/\r//g" filename

this will convert it back to unix

HTH
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline smeghead

  • *
  • 563
  • +0/-0
Error saving email changes - (clam restart failure)
« Reply #2 on: November 08, 2004, 04:43:28 PM »
.. gotta agree with byte on this.

You can of course just crank up the file in pico and resave it to achieve the same result.

The /etc/e-smith/events/email-update/S65restart-clamd file referred to is actually a symbolic link to the /etc/e-smith/events/actions/restart-clamd file; the ownership of this file is root:root and the perms should be 554.

The perms of 554 should make it non writable by anybody other than root!  I'd say a bit of checking may be in order.

HTH
..................

Offline NickCritten

  • *
  • 245
  • +0/-0
Error saving email changes - (clam restart failure)
« Reply #3 on: November 08, 2004, 05:32:38 PM »
Thanks for replying guys :-)

I havn't altered any of those files in windows.. I normally do my txt editing in Midnight Commander..

However just incase, I performed the

perl -p -i -e "s/\r//g" filename

on the files:
/etc/e-smith/events/actions/restart-clamd
/etc/rc.d/init.d/clamd
/etc/rc.d/rc7.d/S97clamd

As these are mentioned in the error.

The /etc/e-smith/events/email-update/S65restart-clamd was not a symlink. So I renamed the file and recreated the symlink.

I also re-set the Owner and Permissions of the file as recommended by smeghead, but I'm still getting the same problem.

Please find the exact errors below:

[root@apollo actions]# chown root.root restart-clamd
[root@apollo actions]# chmod 554 restart-clamd

[root@apollo actions]# /etc/e-smith/events/email-update/S65restart-clamd
/etc/rc.d/init.d/clamd: /etc/rc.d/init.d/clamd: /bin/sh: bad interpreter: Permission denied
/etc/rc.d/init.d/clamd: /etc/rc.d/init.d/clamd: /bin/sh: bad interpreter: Permission denied
serviceControl: Couldn't system(/etc/rc.d/rc7.d/S97clamd, restart):
Couldn't restart clamd at /etc/e-smith/events/email-update/S65restart-clamd line 42.


Line 42 of the file is:

esmith::util::serviceControl
       (
           NAME      => 'clamd',
           ACTION    => $action
        ) ||
        die "Couldn't $action clamd";


Obviously I performed all of the above step by step, testing after each change, No change though :-(

Has anyone any other Ideas?
...
Nick

"No good deed goes unpunished." :-x...

Offline Knuddi

  • *
  • 540
  • +0/-0
    • http://www.scanmailx.com
Error saving email changes - (clam restart failure)
« Reply #4 on: November 08, 2004, 09:13:59 PM »
Which version of ClamAV have you installed? If you installed 0.80-es01 or es02 from sme.swerts-knudsen.dk then this could occure due to me overseeing a conf file change in clamav.

Download the new script and run a upgrade. You will by the way also get the access to the new mirror features which was part of clamav 0.8.

Rgds,
Jesper Knudsen

Offline NickCritten

  • *
  • 245
  • +0/-0
Error saving email changes - (clam restart failure)
« Reply #5 on: November 09, 2004, 11:00:53 AM »
:-D  :-D

Yes!

You fixed it Jesper!

Thanks a million :-)
...
Nick

"No good deed goes unpunished." :-x...