| Welcome to the Zimbra :: Forums! | |
Welcome, if you would like to post a comment please register.
We also encourage you to explore all things Zimbra with our team and members of the community.
|  | | 
12-17-2008, 08:46 AM
| | Intermediate Member | |
Posts: 18
| | This produces empty report, but because it's still trying to get yesterday at midnight through today at midnight and the mta table has data from this morning (after midnight). However, the following looks to produce a good report:
mail:~# sudo -u zimbra /opt/zimbra/libexec/zmdailyreport -time 20081217000000,20081217235959
Generating report
From 2008-12-17 00:00:00 to 2008-12-17 23:59:59
13 messages found for 16 total recipients (3 unique)
72892 total bytes
5607.08 average bytes/msg
1.23 average recipients/msg
0.62 average delay/msg (sec)
Errors
Most active senders
3 xxx@zimbra.com
3 xxx@mail.domain.com
1 xxx@redstationun.com
1 xxx@importantpro.com
1 xxx@nevaquail.com
1 xxx@trickwish.com
1 xxx@avonslobs.net
1 xxx@fonline.de
1 xxx@jerleneroordahost.net
Most active recipients
7 xxx@magnoliasevents.com
6 xxx@lzmarine.net
3 xxx@mail.domain.com
mail:~#
I think once I verify the report after the offline backup, I'll recap the steps and mark it as solved... sound good? I'm still curious why ZCS 5.0.11 and earlier were fine, but 5.0.12 has the problem. Also interesting that the report had data from the day on which I did the install, but not after the offline backup (just zmcontrol stop, copy, and zmcontrol start.)
Thanks again for the help.
__________________ Zimbra: 5.0.13_GA_2791_UBUNTU8 OS: Ubuntu 8.04.2 Kernel: Linux 2.6.24-19-server #1 SMP Wed Aug 20 23:54:28 UTC 2008 i686 GNU/Linux
| 
12-17-2008, 08:48 AM
| | Zimbra Employee | |
Posts: 114
| | Quote:
Originally Posted by lzmarine This produces empty report, but because it's still trying to get yesterday at midnight through today at midnight and the mta table has data from this morning (after midnight). However, the following looks to produce a good report:
mail:~# sudo -u zimbra /opt/zimbra/libexec/zmdailyreport -time 20081217000000,20081217235959
Generating report
From 2008-12-17 00:00:00 to 2008-12-17 23:59:59
13 messages found for 16 total recipients (3 unique)
72892 total bytes
5607.08 average bytes/msg
1.23 average recipients/msg
0.62 average delay/msg (sec)
Errors
Most active senders
3 xxx@zimbra.com
3 xxx@mail.domain.com
1 xxx@redstationun.com
1 xxx@importantpro.com
1 xxx@nevaquail.com
1 xxx@trickwish.com
1 xxx@avonslobs.net
1 xxx@fonline.de
1 xxx@jerleneroordahost.net
Most active recipients
7 xxx@magnoliasevents.com
6 xxx@lzmarine.net
3 xxx@mail.domain.com
mail:~#
I think once I verify the report after the offline backup, I'll recap the steps and mark it as solved... sound good? I'm still curious why ZCS 5.0.11 and earlier were fine, but 5.0.12 has the problem. Also interesting that the report had data from the day on which I did the install, but not after the offline backup (just zmcontrol stop, copy, and zmcontrol start.)
Thanks again for the help. | That is odd. Well let us know how it goes! | 
12-18-2008, 05:51 AM
| | Intermediate Member | |
Posts: 18
| | Mail report content success!!! The problem is that running a cron shell on Ubunbtu that does zmcontrol stop and zmcontrol start does not properly start zmlogswatch (logger). I tried both of the following ways in my cron shell script (runs as root):
sudo -u zimbra /opt/zimbra/bin/zmcontrol start
-- AND ALSO --
. /opt/zimbra/.bashrc
sudo -u zimbra /opt/zimbra/bin/zmcontrol start
The service starts correctly if I su to zimbra user from root, run . /opt/zimbra/.bashrc, then run /opt/zimbra/bin/zmcontrol start
It seems like an environment issue, but I'm likley missing something simple here.
__________________ Zimbra: 5.0.13_GA_2791_UBUNTU8 OS: Ubuntu 8.04.2 Kernel: Linux 2.6.24-19-server #1 SMP Wed Aug 20 23:54:28 UTC 2008 i686 GNU/Linux
| 
12-18-2008, 06:02 AM
| | Zimbra Employee | |
Posts: 114
| | Quote:
Originally Posted by lzmarine Mail report content success!!! The problem is that running a cron shell on Ubunbtu that does zmcontrol stop and zmcontrol start does not properly start zmlogswatch (logger). I tried both of the following ways in my cron shell script (runs as root):
sudo -u zimbra /opt/zimbra/bin/zmcontrol start
-- AND ALSO --
. /opt/zimbra/.bashrc
sudo -u zimbra /opt/zimbra/bin/zmcontrol start
The service starts correctly if I su to zimbra user from root, run . /opt/zimbra/.bashrc, then run /opt/zimbra/bin/zmcontrol start
It seems like an environment issue, but I'm likley missing something simple here. | Well, it won't work the way you tried with . .bashrc because you're taking the .bashrc environment and then losing it when you sudo, but what seems odd is that you should still be picking it up when you take zimbra's shell but you're not (and I'm guessing you're just getting roots environment again). What shell does zimbra have (finger zimbra or grep zimbra /etc/passwd). Another thing you might try is creating a script like /usr/local/bin/restartzimbra.sh with the following: Code: #!//bin/bash
source /opt/zimbra/.bashrc
/opt/zimbra/bin/zmcontrol stop
/opt/zimbra/bin/zmcontrol start and then using your previous commandline like: Code: sudo -u zimbra /usr/local/bin/restartzimbra.sh Really though, I'm not sure why you're passing through sudo when you're already root. Doing something like Code: su - zimbra -c "/opt/zimbra/bin/zmcontrol start" Would be sufficient since you're root, and should definitely pick up zimbra's environment. Similarly, switching to user zimbra from root and making sure to get zimbra's environment would be: | 
12-18-2008, 06:31 AM
| | Intermediate Member | |
Posts: 18
| | I'm fairly new to the sudo methodology, so I figured I was not doing something simple. I ran a test script, below, that works for restarting the services successfully! Thank you for all your help.
#!/bin/sh
su - zimbra -c "/opt/zimbra/bin/zmcontrol stop"
su - zimbra -c "/opt/zimbra/bin/zmcontrol start"
su - zimbra -c "/opt/zimbra/bin/zmcontrol status"
The solution was 2-fold; first (and primarily), install swatch (`apt-get install swatch` and accept all dependencies), then correct MY faulty backup script to not use sudo, but standard su as recommended by tonster.
__________________ Zimbra: 5.0.13_GA_2791_UBUNTU8 OS: Ubuntu 8.04.2 Kernel: Linux 2.6.24-19-server #1 SMP Wed Aug 20 23:54:28 UTC 2008 i686 GNU/Linux
| 
01-23-2011, 08:02 AM
| | | Quote:
Originally Posted by lzmarine sudo -u zimbra /opt/zimbra/bin/zmcontrol start
-- AND ALSO --
. /opt/zimbra/.bashrc
sudo -u zimbra /opt/zimbra/bin/zmcontrol start
The service starts correctly if I su to zimbra user from root, run . /opt/zimbra/.bashrc, then run /opt/zimbra/bin/zmcontrol start
It seems like an environment issue, but I'm likley missing something simple here. | I had the similar issue - logger and stats services were constantly stopping. And running
"sudo -u zimbra ..."
from root, did not helped, the same with
"sudo -u zmlogswatchctl restart"
Then I switched to zimbra And started services correctly.
I found in logs, it can be connected with PERL PATH? | 
01-23-2011, 08:29 AM
| | Zimbra Consultant & Moderator | |
Posts: 20,316
| | This thread is over two years old and is not the same version of Zimbra that you have installed. The 'stats' service in Zimbra has changed completely since this version. Quote:
Originally Posted by arnisraido Then I switched to zimbra | You should not use that command to switch to the Zimbra user, you should always use the following command: The hyphen in that command is important as it creates the correct command environment.
__________________
Regards
Bill
| 
01-23-2011, 08:49 AM
| | | Thank You, I will notice this.
__________________
Release 6.0.10_GA_2692.UBUNTU10_64 UBUNTU10_64 NETWORK edition.
| | Thread Tools | Search this Thread | | | | | Display Modes | Linear Mode | | Why Join? Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.  |