LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-29-2014, 11:45 PM   #1
jerrybu01
LQ Newbie
 
Registered: Mar 2014
Posts: 5

Rep: Reputation: Disabled
Error when start zimbra by script


i install zimbra mail zcs 8.0.6 on ubuntu server 12.04
i have a script to backup:
#!/bin/sh
DIR_SRC=/opt/zimbra
DIR_DST=/bkpZimbra
FILE="Backup_Zimbra_"`date +%Y%m%d%H%M%S`".tar.gz"

#stop zimbra
echo "Stop Zimbra service"
sudo -u zimbra /opt/zimbra/bin/zmcontrol stop

#stop pending zimbra process
echo "Kill other pending zimbra process"
ps auxww | awk '{print $1" "$2}' | grep zimbra | kill -9 `awk '{print $2}'`

#generate backup file
echo "Begin generate back up file. Waitting ....."
tar cpzf ${DIR_DST}/${FILE} ${DIR_SRC}
echo "Back up file done. "

#put backup an an ftp server
echo "Begin upload to FTP. Waitting"
curl -T ${DIR_DST}/${FILE} ftp://192.168.1.100 -u $USERNAME:$PASSWORD
echo "Upload back up file to FTP done"

#clean backup file
echo "Deleting uploaded file"
rm -f ${DIR_DST}/${FILE}
echo "Delete done"

#start zimbra
sudo -u zimbra /opt/zimbra/bin/zmcontrol start
echo "Back up done"

When th script start zimbra i have a problem with "logger" like this:
Host ubuntu.local
Starting ldap...Done.
Starting zmconfigd...Done.
Starting logger...Failed.
Starting logswatch...failed.


Starting mailbox...Done.
Starting antispam...Done.
Starting antivirus...Done.
Starting opendkim...Done.
Starting snmp...Done.
Starting spell...Done.
Starting mta...Done.
Starting stats...Done.

But when i start zimbra by command like this, it works. i don't understand to fix the problem above

root@ubuntu:~# su zimbra
zimbra@ubuntu:/root$ zmcontrol start
Host ubuntu.local
Starting zmconfigd...Done.
Starting logger...Done.
Starting mailbox...Done.
Starting antispam...Done.
Starting antivirus...Done.
Starting opendkim...Done.
Starting snmp...Done.
Starting spell...Done.
Starting mta...Done.
Starting stats...Done.
 
Old 07-30-2014, 12:11 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

Better use su instead of sudo in the stop/start zimbra commands. I.e replace:
Quote:
sudo -u zimbra /opt/zimbra/bin/zmcontrol stop
...
sudo -u zimbra /opt/zimbra/bin/zmcontrol start
with:
Code:
su - zimbra -c "/opt/zimbra/bin/zmcontrol stop"
...
su - zimbra -c "/opt/zimbra/bin/zmcontrol start"
Regards
 
Old 07-30-2014, 07:41 PM   #3
jerrybu01
LQ Newbie
 
Registered: Mar 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
Hi,

Better use su instead of sudo in the stop/start zimbra commands. I.e replace:
with:
Code:
su - zimbra -c "/opt/zimbra/bin/zmcontrol stop"
...
su - zimbra -c "/opt/zimbra/bin/zmcontrol start"
Regards
I tried your code but the same error.
Error script:
.........
Host ubuntu.local
Starting ldap...Done.
dpkg: warning: failed to open configuration file '/root/.dpkg.cfg' for reading: Permission denied
Starting zmconfigd...Done.
dpkg: warning: failed to open configuration file '/root/.dpkg.cfg' for reading: Permission denied
Starting logger...Failed.
Starting logswatch...failed.


dpkg: warning: failed to open configuration file '/root/.dpkg.cfg' for reading: Permission denied
dpkg: warning: failed to open configuration file '/root/.dpkg.cfg' for reading: Permission denied
dpkg: warning: failed to open configuration file '/root/.dpkg.cfg' for reading: Permission denied
dpkg: warning: failed to open configuration file '/root/.dpkg.cfg' for reading: Permission denied
Starting mailbox...Done.
Starting antispam...Done.
Starting antivirus...Done.
Starting opendkim...Failed.
opendkim: /opt/zimbra/conf/opendkim.conf: ldap://ubuntu.local:389/?DKIMSelector?sub?(DKIMIdentity=$d): dkimf_db_open(): Connect error
Failed to start opendkim: 0


Starting snmp...Done.
Starting spell...Done.
dpkg: warning: failed to open configuration file '/root/.dpkg.cfg' for reading: Permission denied
Starting mta...Done.
Starting stats...Done.

Last edited by jerrybu01; 07-30-2014 at 09:16 PM.
 
Old 07-31-2014, 01:24 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
dpkg: warning: failed to open configuration file '/root/.dpkg.cfg' for reading: Permission denied
Huh, I don't know why zimbra wants to read that file.
I'm using this backup script on Centos and it works fine. Perhaps you could give it a try.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Zimbra Backup Script pople Linux - Software 4 08-08-2014 01:20 PM
migrating aliases & groups from SME7 to Zimbra using a perl script agarrett5 Linux - Server 1 05-16-2014 08:19 PM
Need Shell Script to parse Zimbra Sync.log rlug Linux - General 1 01-08-2012 08:29 AM
Zimbra Ldap Error Rahul Kolan Linux - Server 1 01-23-2009 02:39 AM
LXer: Zimbra Goes Offline With Zimbra Desktop LXer Syndicated Linux News 0 03-28-2007 12:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration