[Solved] - Monit will not start after ClamAV update to 0.96

This forum is for all copfilter support related questions in English.
moshari_3
Posts: 152
Joined: 07 Apr 2010 03:43
Location: Australia

[Solved] - Monit will not start after ClamAV update to 0.96

Post by moshari_3 »

Hi all!
Please forgive me if this has already been posted and dealt with but I can't find it or something similar.

My problem is I look after 6 IPCop systems 1 is mine & 5 are for friends but now that I have just updated ClamAV to VER 0.96 and on 5 systems all is well but on 1 of them monit now refuses to start.
This is the message I now get.

starting monit
mo:2345:respawn:/var/log/copfilter/default/opt/monit/default/bin/monit -I -c /var/log/copfilter/default/opt/monit/etc/monitrc waiting 3 second(s)
monit is not running

Also the log file does not seem to be being updated since this happened. /var/log/copfilter/0.84beta4/opt/monit/var/log/monit.log

I don't know Linux itself very well but I did manage to find that the monitrc file located in /var/log/copfilter/0.84.beta4/opt/monit/etc/ was actually 0 bytes.
I copied this from my IPC and made the changes for ip range, subnet & email settings but this did not solve my problem. I still get the same message.

Some basic info: Linux Kernel = 2.4.36 - IPCop = 1.4.21 - Advanced Proxy = 3.0.5 - URL Filter = 1.9.3 - Copfilter = 0.84beta4 with Monit = 5.0.3 - P3scan = 2.3.2 - proxsmtpd = 1.8 (not used) - HAVP = 0.91
privoxy = 3.0.10 - frox = 0.7.18 - SpamAssasin = 3.2.5 - ClamAV = 0.96/10711 - F-PROT = 6.2.1.4252 - Renattach = 1.2.4 - Rules De Juor = 1.30

I can retrieve any other info you need to help me but please be very specific on the locations of what you need from me as my knowledge of IPcop at the command / terminal level is very limited.

Thank you in advance.
Last edited by moshari_3 on 08 Apr 2010 18:34, edited 2 times in total.

FischerM
Site Admin
Posts: 545
Joined: 09 Dec 2009 19:24
Location: Rheinbach

Re: Monit will not start after ClamAV update to 0.96

Post by FischerM »

Hi!

Ok, lets try... :-)

What makes me wonder: how was that 'monitrc' set to 0 Bytes...

You already copied another 'monitrc'-File from another PC.
I copied this from my IPC and made the changes for ip range, subnet & email settings
First: lets have a look at the rights...

Please post output of:

Code: Select all

ls /var/log/copfilter/default/opt/monit/etc/ -l
It should look similar to this:
root@DevelCop:~/copfilter/opt/monit/etc # ls /var/log/copfilter/default/opt/monit/etc/ -l
total 12
drwxr-xr-x 2 root root 4096 2008-07-05 15:53 init.d
-rwx------ 1 root root 5640 2010-04-07 14:50 monitrc
HTH
Matthias

Severus
Site Admin
Posts: 457
Joined: 10 Dec 2009 07:01
Location: Nürnberg - Germany

Re: Monit will not start after ClamAV update to 0.96

Post by Severus »

Hi moshari_3,

the monitrc file you mentioned is rewritten by /var/log/copfilter/default/opt/monit/etc/init.d/copfilter_monit on every start. Though you replaced this file and did your sttings manually this will not help if the file is damaged by copfilter_monit again. Did you any changes to the copfilter_monit file? A monitrc with a file size of zero results if any bug in this file prevents the monitrc from beeing rewritten correctly. As a first aid you may replace monitrc from source and try to start monit from the console by

Code: Select all

/var/log/copfilter/default/opt/monit/etc/init.d/copfilter_monit debug
and watch the output.
If the monitrc file will be damaged again please replace the copfilter_monit file from source, too and try again.
Another hint: check your /var/log/copfilter/default/etc/global_settings if present and if the settings for monit, smtp host, smtp address etc are correct and if the file
/var/log/copfilter/default/etc/monit_enable
exists. If not create one with *touch* command.
Regards Severus

moshari_3
Posts: 152
Joined: 07 Apr 2010 03:43
Location: Australia

Re: Monit will not start after ClamAV update to 0.96

Post by moshari_3 »

Hi FischerM and Severus.
Firstly thank you both for responding.
Sorry my answers may take awhile as I am in a approx +11 hour time zone so please be patient with me.

FischerM - I copied the monitrc file from a working IPC and edited it because the problem IPC had a monitrc file size of Zero. Since I copied it over the file size and content has remained the same.
I have entered the command you request "ls /var/log/copfilter/default/opt/monit/etc/ -l" and the response was similar but not the same access rights.
Sorry I have no idea how to change them, I think I use the chmod command but again have no idea of the correct syntax.
total 20
drwxr-xr-x 2 root root 4096 2009-10-03 21:48 init.d
-rw-r--r-- 1 root root 5676 2010-04-07 20:30 monitrc
-rw-r--r-- 1 root root 5686 2010-04-07 10:25 monitrc-BAK-2010_04_07
-rwx------ 1 root root 0 2010-04-07 10:16 monitrc-OLD

Severus - You have lost me a little, as I said my terminal level knowledge is very limited, so as best I can I have checked your suggestions.
I do understand that /var/log/copfilter/default/opt/monit/etc/init.d/copfilter_monit overwrites the monitrc file from your description.
I have not made any changes to the copfilter_monit file however I did look but didn't really understand how it worked so I left it alone.
Since I changed and edited monitrc before my original posting it has not reverted to the Zero file size even though I have tried many times to restart monit from the Copfilter GUI.

It is probably important to mention that after discovering this problem I did try to reinstall monit from the monit_5.0.3_copfilter.tar.gz downloaded update but it made no difference.
Sorry I forgot to mention this in my original post.


When I entered the commad "/var/log/copfilter/default/opt/monit/etc/init.d/copfilter_monit debug" I get the following:
monit is not running
waiting 0 second(s)
/var/log/copfilter/default/opt/monit/etc/init.d/copfilter_monit: line 279: debug: command not found
monit is not running

The monitrc file is unchanged.
Also /var/log/copfilter/0.84beta4/opt/monit/var/log/monit.log file has not been updated since 06-04-2010 which was the date I started having this problem.
The file /var/log/copfilter/default/etc/global_settings does exist and all the settings match what I expect. (I may have made a mistake due to lack of knowledge)
The file /var/log/copfilter/default/etc/monit_enable is also there.

I'm not sure exactly what you mean "from source" I assume this is not from a working IPC but from the tar.gz or install folder?
Also I do not know what the " *touch* command " is.

Please note I have not made any changes since my original post but just investigated your suggestions to the best of my abilty / knowledge.

Again thank you both for being patient with me so far and I hope to hear more from you soon towards a solution.

FischerM
Site Admin
Posts: 545
Joined: 09 Dec 2009 19:24
Location: Rheinbach

Re: Monit will not start after ClamAV update to 0.96

Post by FischerM »

Hi!

First try:
moshari_3 wrote:Sorry I have no idea how to change them, I think I use the chmod command but again have no idea of the correct syntax.
As far as I can see from here, the rights 'monitrc' must have been changed by something...

On the console, change to directory '/var/log/copfilter/default/opt/monit/etc':

Code: Select all

cd /var/log/copfilter/default/opt/monit/etc
and adjust file rights:

Code: Select all

chown -v 0700 monit.rc
It should look like this:
root@DevelCop:~/copfilter/opt/monit/etc # chmod -v 0700 monitrc
mode of `monitrc' changed to 0700 (rwx------)
Second:
moshari_3 wrote:/var/log/copfilter/default/opt/monit/etc/init.d/copfilter_monit: line 279: debug: command not found
Please post the contents of Line 279!

HTH
Matthias

moshari_3
Posts: 152
Joined: 07 Apr 2010 03:43
Location: Australia

Re: Monit will not start after ClamAV update to 0.96

Post by moshari_3 »

Hi again FischerM.

Sorry I took so long I had to wait for the ip change to come through the DNS so I could access the remote IPC.

The original file rights probably changed because I renamed the original file to monitrc-OLD and then uploaded the copy of the monitrc from my IPC them made the changes to IP & subnet with email and the wrong rights were probably set by filezilla.

I did what you suggested but I don't think it went right.
root@FW100:~ # cd /var/log/copfilter/default/opt/monit/etc
root@FW100:/var/log/copfilter/default/opt/monit/etc # ls
init.d monitrc monitrc-BAK-2010_04_07 monitrc-OLD
root@FW100:/var/log/copfilter/default/opt/monit/etc # chown -v 0700 monit.rc
chown: cannot access `monit.rc': No such file or directory
failed to change ownership of `monit.rc' to 0700
root@FW100:/var/log/copfilter/default/opt/monit/etc # chown -v 0700 monitrc (I changed monit.rc to monitrc as I thought it was a typo)
changed ownership of `monitrc' to 0700
root@FW100:/var/log/copfilter/default/opt/monit/etc # ls /var/log/copfilter/default/opt/monit/etc/ -l
total 20
drwxr-xr-x 2 root root 4096 2009-10-03 21:48 init.d
-rw-r--r-- 1 privoxy root 5676 2010-04-07 20:30 monitrc (IT has change the owner but not the rights???)
-rw-r--r-- 1 root root 5686 2010-04-07 10:25 monitrc-BAK-2010_04_07
-rwx------ 1 root root 0 2010-04-07 10:16 monitrc-OLD

As for line 279 of copfilter_monit I wasn't very sure how to get this so I downloaded the file then used Text editor in my Linux Mint to get the line.

I have included a couple of lines either side of line 279. They didn't make sense to me especialy with what I had read that will make monit confused for lack of a better expression.
I added the Line 277 etc so you had a better chance to work out.

debug) Line 277
stop Line 278
debug Line 279
status Line 280
;; Line 281

Line 279 is counted including all empty lines in the file.

I hope this is correct or is there a better way to accurately get to the true line 279?

PS: just for the sake of it I ran /var/log/copfilter/default/opt/monit/etc/init.d/copfilter_monit debug again but still get the same error about line 279.

Thanks

Severus
Site Admin
Posts: 457
Joined: 10 Dec 2009 07:01
Location: Nürnberg - Germany

Re: Monit will not start after ClamAV update to 0.96

Post by Severus »

Hi,
moshari_3 wrote:-rw-r--r-- 1 privoxy root 5676 2010-04-07 20:30 monitrc (IT has change the owner but not the rights???)
if I remember well monitrc must have owner.group root and mod 600
Please try

Code: Select all

cd /var/log/copfilter/default/opt/monit/etc
chown root.root monitrc
chmod 600 monitrc
and try to restart monit

Regards Severus

FischerM
Site Admin
Posts: 545
Joined: 09 Dec 2009 19:24
Location: Rheinbach

Re: Monit will not start after ClamAV update to 0.96

Post by FischerM »

Hi severus! :-)

I bet you a beer- its "0700"

Just expanded 0.84beta4:
root@DevelCop:/tmp/test/copfilter-0.84beta4/var/log/copfilter/0.84beta4/opt/monit/etc # ls -l
total 12
drwxr-xr-x 2 root root 4096 2008-07-05 15:53 init.d
-rwx------ 1 root root 5654 2009-02-24 21:02 monitrc

moshari_3
Posts: 152
Joined: 07 Apr 2010 03:43
Location: Australia

Re: Monit will not start after ClamAV update to 0.96

Post by moshari_3 »

Well *beep* thankyou Severus.

This seems to have resolved the problem. :D

I really don't understand why considering the history over the last 2 days??????

After the changes for ownership & rights I used the copfilter GUI to start Monit & all is well.

cd /var/log/copfilter/default/opt/monit/etc
chown root.root monitrc
chmod 600 monitrc

One command at a time of course.

Just to be sure I then selected restart all service & again all is well. Still need to do a full system reboot but that can wait until really needed unless you recommend testing to be sure.
I am even getting the email notices again about changes. :mrgreen:

Again thank you both so much for all your help I really do appreciate it.

By the way how can I mark this as solved?

Severus
Site Admin
Posts: 457
Joined: 10 Dec 2009 07:01
Location: Nürnberg - Germany

Re: Monit will not start after ClamAV update to 0.96

Post by Severus »

Hi,
edit your first post in this thread and add a [solved] to the subject before the current one.
Severus

Post Reply