Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

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.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-06-2010, 12:02 AM
Active Member
 
Posts: 47
Question [SOLVED] Help, I think I am running Zimbra as root!

Hello,

I am having some trouble running a backup-script made for the FOSS-edition, and therefore posted some questions in this thread:
[SOLVED] Yet Another Backup Script for Community Version

What I learned from the response is that it seems that I am running Zimbra as root, which is absolutely not my intention!

I don't want to hijack the above mentioned thread, so I post my question here instead.

If i run the following command it gives the result "root". It should have returned "zimbra", right?
Code:
administrator@mail:~$ ps -ef | grep '/opt/zimbra' | grep "java" | grep -v "zmmailboxdmgr" | grep -v grep | awk '{print $1}' | head -n 1
root
administrator@mail:~$
If I restart Zimbra manually I do it like this:
Code:
administrator@mail:~$ sudo su
[sudo] password for administrator:
root@mail:/home/administrator# su zimbra
zimbra@mail:/home/administrator$ zmcontrol restart
In my naivity I believed that this made Zimbra run as the Zimbra-user, not root...

What do I have to do to ensure that I am running Zimbra as the correct user?

Thankyou for any response!
Reply With Quote
  #2 (permalink)  
Old 10-06-2010, 12:06 AM
Moderator
 
Posts: 7,928
Default

Code:
su - zimbra
zmcontrol stop ; zmcontrol start
Notive the '-' between su and zimbra. That informs the shell to source in the environment variables.

You may also have accidentally broken some of the permissions by running as root so I would suggest shutting down ZCS and then running as root /opt/zimbra/libexec/zmfixperms --extended
__________________
Reply With Quote
  #3 (permalink)  
Old 10-06-2010, 12:12 AM
Active Member
 
Posts: 47
Default

Thank you!

I have allready (after suggestions from LaFong) tried with the "-", but that didn't make any difference.

I will now try the zmfixperm, but since this is in a production-environment I will have to prepare my users before shutting down the server.
I will report the results when done.
Reply With Quote
  #4 (permalink)  
Old 10-06-2010, 02:12 AM
Active Member
 
Posts: 47
Default

Ok,
I ran the command
Code:
./zmfixperms --extendend
but still Zimbra is run as root. I recieved no errors.

Which log should I look at in order to see what went wrong?
Reply With Quote
  #5 (permalink)  
Old 10-06-2010, 02:19 AM
Moderator
 
Posts: 7,928
Default

Please post the following
Code:
ps aux | grep zimbra
grep zimbra /etc/sudoers
__________________
Reply With Quote
  #6 (permalink)  
Old 10-06-2010, 02:23 AM
Active Member
 
Posts: 47
Default

Quote:
Originally Posted by uxbod View Post
Please post the following
Code:
ps aux | grep zimbra
grep zimbra /etc/sudoers
I am so greatful for your efforts to help me!

Here are the (long) outout of the commands:
Code:
root@mail:/home/administrator/Skript# ps aux | grep zimbra
root      8777  0.0  0.6 406028 12896 ?        Sl   Oct04   0:36 /opt/zimbra/java/bin/java -Xmx256M -Dfile.encoding=UTF-8 org.hsqldb.Server -database.0 /opt/Funambol/tools/hypersonic/data/funambol -dbname.0 funambol
root      8791  0.0  1.2 418508 24880 ?        Sl   Oct04   0:36 /opt/zimbra/java/bin/java -Dfile.encoding=UTF-8 -Dfunambol.home=/opt/Funambol -Djava.net.preferIPv4Stack=true -Xmx256M -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=7101 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false com.funambol.ctp.server.CTPServer
root      8818  0.1  2.5 702992 52340 ?        Sl   Oct04   3:51 /opt/zimbra/java/bin/java -Xmx512M -Dfunambol.debug=false -Dfunambol.home=/opt/Funambol -Dfile.encoding=UTF-8 -Djava.library.path=/opt/Funambol/ds-server/lib/linux -Djavax.net.ssl.trustStore=/opt/Funambol/ds-server/lib/security/cacerts -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8101 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/opt/Funambol/tools/tomcat/conf/logging.properties -Djava.endorsed.dirs=/opt/Funambol/tools/tomcat/endorsed -classpath :/opt/Funambol/tools/tomcat/bin/bootstrap.jar -Dcatalina.base=/opt/Funambol/tools/tomcat -Dcatalina.home=/opt/Funambol/tools/tomcat -Djava.io.tmpdir=/opt/Funambol/tools/tomcat/temp org.apache.catalina.startup.Bootstrap start
root      8855  0.0  1.1 415388 22776 ?        Sl   Oct04   0:33 /opt/zimbra/java/bin/java -Dfile.encoding=UTF-8 -Dfunambol.home=/opt/Funambol -Dfunambol.pushlistener.config.bean=com/funambol/email/inboxlistener/InboxListenerConfiguration.xml -Djava.library.path=/opt/Funambol/inbox-listener/lib/linux -Djavax.net.ssl.trustStore=/opt/Funambol/inbox-listener/lib/security/cacerts -Djava.net.preferIPv4Stack=true -Xmx256M -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=4101 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false com.funambol.email.inboxlistener.service.InboxListener
root      8869  0.0  1.0 415688 22668 ?        Sl   Oct04   0:33 /opt/zimbra/java/bin/java -Dfile.encoding=UTF-8 -Dfunambol.home=/opt/Funambol -Dfunambol.pushlistener.config.bean=com/funambol/pimlistener/PIMListenerConfiguration.xml -Djava.net.preferIPv4Stack=true -Xmx256M -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3101 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false com.funambol.pimlistener.service.PimListener
zimbra   11296  0.0  1.5 139320 32064 ?        Ssl  11:08   0:00 /opt/zimbra/openldap/sbin/slapd -l LOCAL0 -4 -u zimbra -h ldap://mail.mailserver.no:389 ldapi:/// -F /opt/zimbra/data/ldap/config
zimbra   12604  0.0  0.3  10716  6984 ?        Ss   11:08   0:00 /opt/zimbra/libexec/logswatch --config-file=/opt/zimbra/conf/logswatchrc --use-cpan-file-tail --pid-file=/opt/zimbra/log/logswatch.pid --daemon --script-dir=/opt/zimbra/data/tmp -t /var/log/zimbra-stats.log
zimbra   12605  0.0  0.3  18328  6532 ?        S    11:08   0:00 /usr/bin/perl /opt/zimbra/libexec/zmlogger
zimbra   12707  0.0  0.1   8708  3924 ?        S    11:08   0:00 zmlogger: zmrrdfetch: server
zimbra   12713  0.0  0.3  11092  7620 ?        Ss   11:08   0:00 /usr/bin/perl /opt/zimbra/libexec/zmmtaconfig
zimbra   12738  0.0  0.0   4512  1788 ?        S    11:08   0:00 /bin/sh /opt/zimbra/mysql/bin/mysqld_safe --defaults-file=/opt/zimbra/conf/my.cnf --external-locking --log-error=/opt/zimbra/log/mysql_error.log --ledir=/opt/zimbra/mysql/libexec
zimbra   12939  0.2  7.6 612840 157824 ?       Sl   11:08   0:01 /opt/zimbra/mysql/libexec/mysqld --defaults-file=/opt/zimbra/conf/my.cnf --basedir=/opt/zimbra/mysql --datadir=/opt/zimbra/db/data --pid-file=/opt/zimbra/db/mysql.pid --skip-external-locking --port=7306 --socket=/opt/zimbra/db/mysql.sock --external-locking
root     14701  0.0  0.0   1704   380 ?        Ss   11:08   0:00 /opt/zimbra/libexec/zmmailboxdmgr start -server -Djava.awt.headless=true -XX:+UseConcMarkSweepGC -XX:NewRatio=2 -XX:PermSize=128m -XX:MaxPermSize=128m -XX:SoftRefLRUPolicyMSPerMB=1 -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCApplicationStoppedTime -Dsun.net.inetaddr.ttl= -Xss256k -Xms807m -Xmx807m -Xmn201m
zimbra   14702  3.2 15.6 1161148 324248 ?      Sl   11:08   0:27 /opt/zimbra/java/bin/java -server -Djava.awt.headless=true -XX:+UseConcMarkSweepGC -XX:NewRatio=2 -XX:PermSize=128m -XX:MaxPermSize=128m -XX:SoftRefLRUPolicyMSPerMB=1 -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCApplicationStoppedTime -Dsun.net.inetaddr.ttl= -Xss256k -Xms807m -Xmx807m -Xmn201m -Djava.io.tmpdir=/opt/zimbra/mailboxd/work -Djava.library.path=/opt/zimbra/lib -Djava.endorsed.dirs=/opt/zimbra/mailboxd/common/endorsed -Dzimbra.config=/opt/zimbra/conf/localconfig.xml -Djetty.home=/opt/zimbra/mailboxd -DSTART=/opt/zimbra/mailboxd/etc/start.config -jar /opt/zimbra/mailboxd/start.jar /opt/zimbra/mailboxd/etc/jetty.properties /opt/zimbra/mailboxd/etc/jetty-setuid.xml /opt/zimbra/mailboxd/etc/jetty.xml
zimbra   14712  0.0  0.0  44004   908 ?        Ssl  11:08   0:00 /opt/zimbra/memcached/bin/memcached -d -P /opt/zimbra/log/memcached.pid
zimbra   15739  0.0  0.0   4836   720 ?        Ss   11:09   0:00 nginx: master process /opt/zimbra/nginx/sbin/nginx -c /opt/zimbra/conf/nginx.conf
zimbra   15741  0.0  0.1   6728  2672 ?        S    11:09   0:00 nginx: worker process
zimbra   15742  0.0  0.1   6728  2692 ?        S    11:09   0:00 nginx: worker process
zimbra   15745  0.0  0.1   6728  2692 ?        S    11:09   0:00 nginx: worker process
zimbra   15747  0.0  0.1   6728  2684 ?        S    11:09   0:00 nginx: worker process
zimbra   15784  0.1  3.0  72816 62228 ?        Ss   11:09   0:00 amavisd (master)
zimbra   15824  0.0  3.3  79484 69656 ?        S    11:09   0:00 amavisd (ch2-avail)
zimbra   15825  0.0  3.2  78016 68048 ?        S    11:09   0:00 amavisd (ch1-avail)
zimbra   15826  0.0  3.1  74940 65200 ?        S    11:09   0:00 amavisd (ch3-avail)
zimbra   15827  0.0  3.1  75040 65092 ?        S    11:09   0:00 amavisd (ch1-avail)
zimbra   15828  0.3  3.2  77416 67708 ?        S    11:09   0:03 amavisd (ch4-avail)
zimbra   15830  0.0  3.1  76000 65940 ?        S    11:09   0:00 amavisd (ch1-avail)
zimbra   15831  0.0  3.1  76100 65632 ?        S    11:09   0:00 amavisd (ch1-avail)
zimbra   15832  0.0  3.1  74244 64260 ?        S    11:09   0:00 amavisd (ch1-avail)
zimbra   15835  0.0  3.1  75152 65584 ?        S    11:09   0:00 amavisd (ch2-avail)
zimbra   15839  0.0  3.1  74504 64560 ?        S    11:09   0:00 amavisd (ch1-avail)
zimbra   15849  1.3 11.7 278760 241876 ?       Ssl  11:09   0:10 /opt/zimbra/clamav/sbin/clamd --config-file=/opt/zimbra/conf/clamd.conf
zimbra   15865  0.0  0.2   7640  4912 ?        S    11:09   0:00 /usr/bin/perl /opt/zimbra/libexec/swatch --config-file=/opt/zimbra/conf/swatchrc --use-cpan-file-tail --script-dir=/opt/zimbra/data/tmp -t /var/log/zimbra.log
zimbra   15875  0.0  0.3  10712  7852 ?        S    11:09   0:00 /usr/bin/perl /opt/zimbra/data/tmp/.swatch_script.15865
zimbra   15876  0.0  0.3  12816  6848 ?        Ss   11:09   0:00 /opt/zimbra/httpd-2.2.15/bin/httpd -k start -f /opt/zimbra/conf/httpd.conf
zimbra   15903  0.0  0.2  12816  6108 ?        S    11:09   0:00 /opt/zimbra/httpd-2.2.15/bin/httpd -k start -f /opt/zimbra/conf/httpd.conf
zimbra   15904  0.0  0.2  12816  6108 ?        S    11:09   0:00 /opt/zimbra/httpd-2.2.15/bin/httpd -k start -f /opt/zimbra/conf/httpd.conf
zimbra   15905  0.0  0.2  12816  6108 ?        S    11:09   0:00 /opt/zimbra/httpd-2.2.15/bin/httpd -k start -f /opt/zimbra/conf/httpd.conf
zimbra   15907  0.0  0.2  12816  6108 ?        S    11:09   0:00 /opt/zimbra/httpd-2.2.15/bin/httpd -k start -f /opt/zimbra/conf/httpd.conf
zimbra   15908  0.0  0.2  12816  6108 ?        S    11:09   0:00 /opt/zimbra/httpd-2.2.15/bin/httpd -k start -f /opt/zimbra/conf/httpd.conf
root     16894  0.0  0.0   7464  1832 ?        Ss   11:09   0:00 /opt/zimbra/postfix/libexec/master
zimbra   16900  0.0  0.0   7388   784 ?        Ss   11:09   0:00 /opt/zimbra/cyrus-sasl/sbin/saslauthd -r -a zimbra
zimbra   16903  0.0  0.0   7388   536 ?        S    11:09   0:00 /opt/zimbra/cyrus-sasl/sbin/saslauthd -r -a zimbra
zimbra   16905  0.0  0.0   7388   508 ?        S    11:09   0:00 /opt/zimbra/cyrus-sasl/sbin/saslauthd -r -a zimbra
zimbra   16906  0.0  0.0   7388   508 ?        S    11:09   0:00 /opt/zimbra/cyrus-sasl/sbin/saslauthd -r -a zimbra
zimbra   16907  0.0  0.0   7388   508 ?        S    11:09   0:00 /opt/zimbra/cyrus-sasl/sbin/saslauthd -r -a zimbra
zimbra   17182  0.0  0.2   7584  4816 ?        S    11:09   0:00 /usr/bin/perl -w /opt/zimbra/libexec/zmstat-proc
zimbra   17184  0.0  0.2   7324  4624 ?        S    11:09   0:00 /usr/bin/perl -w /opt/zimbra/libexec/zmstat-cpu
zimbra   17191  0.0  0.2   7324  4648 ?        S    11:09   0:00 /usr/bin/perl -w /opt/zimbra/libexec/zmstat-vm
zimbra   17193  0.0  0.2   7320  4648 ?        S    11:09   0:00 /usr/bin/perl -w /opt/zimbra/libexec/zmstat-io -x
zimbra   17195  0.0  0.2   7324  4600 ?        S    11:09   0:00 /usr/bin/perl -w /opt/zimbra/libexec/zmstat-df
zimbra   17202  0.0  0.2   7324  4624 ?        S    11:09   0:00 /usr/bin/perl -w /opt/zimbra/libexec/zmstat-io
zimbra   17247  0.0  0.2   7540  4632 ?        S    11:09   0:00 /usr/bin/perl -w /opt/zimbra/libexec/zmstat-fd
zimbra   17260  0.2  0.2   8136  5336 ?        S    11:09   0:01 /usr/bin/perl -w /opt/zimbra/libexec/zmstat-allprocs
zimbra   17274  0.0  0.2   7456  4724 ?        S    11:09   0:00 /usr/bin/perl -w /opt/zimbra/libexec/zmstat-mysql
zimbra   17295  0.0  0.2   7324  4564 ?        S    11:09   0:00 /usr/bin/perl -w /opt/zimbra/libexec/zmstat-mtaqueue
zimbra   17304  0.0  0.2   7748  5000 ?        S    11:09   0:00 /usr/bin/perl -w /opt/zimbra/libexec/zmstat-nginx
root     17601  0.0  0.2   7392  4676 ?        S    11:09   0:00 /usr/bin/perl -w /opt/zimbra/libexec/zmstat-fd
zimbra   17956  0.0  0.0   2032   764 ?        S    11:09   0:00 /usr/bin/iostat -d -k 30
zimbra   17957  0.0  0.0   1860   624 ?        S    11:09   0:00 /usr/bin/vmstat -n -S K 30
zimbra   17958  0.0  0.0   2032   760 ?        S    11:09   0:00 /usr/bin/iostat -d -k -x 30
root     25755  1.9  1.2  58216 25084 ?        S    11:18   0:05 gedit file:///var/log/zimbra.log
root     28816  0.0  0.0   3016   804 pts/1    R+   11:23   0:00 grep zimbra
And:
Code:
root@mail:/home/administrator/Skript# grep zimbra /etc/sudoer
grep: /etc/sudoer: No such file or directory
root@mail:/home/administrator/Skript#

Last edited by primaxx; 10-06-2010 at 02:26 AM.. Reason: typo
Reply With Quote
  #7 (permalink)  
Old 10-06-2010, 02:39 AM
Moderator
 
Posts: 7,928
Default

You missed an 's' of sudoers ... pressing TAB will auto complete the line for you
__________________
Reply With Quote
  #8 (permalink)  
Old 10-06-2010, 02:53 AM
Active Member
 
Posts: 47
Default

Ah...

Here's the output:
Code:
root@mail:/home/administrator/Skript# grep zimbra /etc/sudoers
%zimbra ALL=NOPASSWD:/opt/zimbra/libexec/zmstat-fd *
%zimbra   ALL=NOPASSWD:/opt/zimbra/openldap/libexec/slapd
%zimbra   ALL=NOPASSWD:/opt/zimbra/libexec/zmslapd
%zimbra   ALL=NOPASSWD:/opt/zimbra/postfix/sbin/postfix, /opt/zimbra/postfix/sbin/postalias, /opt/zimbra/postfix/sbin/qshape.pl, /opt/zimbra/postfix/sbin/postconf,/opt/zimbra/postfix/sbin/postsuper
%zimbra   ALL=NOPASSWD:/opt/zimbra/libexec/zmqstat,/opt/zimbra/libexec/zmmtastatus
%zimbra ALL=NOPASSWD:/opt/zimbra/libexec/zmmailboxdmgr
%zimbra ALL=NOPASSWD:/opt/zimbra/bin/zmcertmgr
%zimbra ALL=NOPASSWD:/opt/zimbra/nginx/sbin/nginx
root@mail:/home/administrator/Skript#
Reply With Quote
  #9 (permalink)  
Old 10-06-2010, 09:46 AM
Advanced Member
 
Posts: 213
Default

Code:
root@mail:/home/administrator/Skript# ps aux | grep zimbra | grep -i Funambol
root      8777  0.0  0.6 406028 12896 ?        Sl   Oct04   0:36 /opt/zimbra/java/bin/java -Xmx256M -Dfile.encoding=UTF-8 org.hsqldb.Server -database.0 /opt/Funambol/tools/hypersonic/data/funambol -dbname.0 funambol
root      8791  0.0  1.2 418508 24880 ?        Sl   Oct04   0:36 /opt/zimbra/java/bin/java -Dfile.encoding=UTF-8 -Dfunambol.home=/opt/Funambol -Djava.net.preferIPv4Stack=true -Xmx256M -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=7101 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false com.funambol.ctp.server.CTPServer
root      8818  0.1  2.5 702992 52340 ?        Sl   Oct04   3:51 /opt/zimbra/java/bin/java -Xmx512M -Dfunambol.debug=false -Dfunambol.home=/opt/Funambol -Dfile.encoding=UTF-8 -Djava.library.path=/opt/Funambol/ds-server/lib/linux -Djavax.net.ssl.trustStore=/opt/Funambol/ds-server/lib/security/cacerts -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8101 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/opt/Funambol/tools/tomcat/conf/logging.properties -Djava.endorsed.dirs=/opt/Funambol/tools/tomcat/endorsed -classpath :/opt/Funambol/tools/tomcat/bin/bootstrap.jar -Dcatalina.base=/opt/Funambol/tools/tomcat -Dcatalina.home=/opt/Funambol/tools/tomcat -Djava.io.tmpdir=/opt/Funambol/tools/tomcat/temp org.apache.catalina.startup.Bootstrap start
root      8855  0.0  1.1 415388 22776 ?        Sl   Oct04   0:33 /opt/zimbra/java/bin/java -Dfile.encoding=UTF-8 -Dfunambol.home=/opt/Funambol -Dfunambol.pushlistener.config.bean=com/funambol/email/inboxlistener/InboxListenerConfiguration.xml -Djava.library.path=/opt/Funambol/inbox-listener/lib/linux -Djavax.net.ssl.trustStore=/opt/Funambol/inbox-listener/lib/security/cacerts -Djava.net.preferIPv4Stack=true -Xmx256M -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=4101 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false com.funambol.email.inboxlistener.service.InboxListener
root      8869  0.0  1.0 415688 22668 ?        Sl   Oct04   0:33 /opt/zimbra/java/bin/java -Dfile.encoding=UTF-8 -Dfunambol.home=/opt/Funambol -Dfunambol.pushlistener.config.bean=com/funambol/pimlistener/PIMListenerConfiguration.xml -Djava.net.preferIPv4Stack=true -Xmx256M -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3101 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false com.funambol.pimlistener.service.PimListener
You have installed funambol, and it is using the java in the /opt/zimbra directory, and running its processes as root. When you restart Zimbra, you are not restarting funambol. so the root-owned funambol processes are always at the top of the list. Change the running-as user query to ignore funambol:
Code:
administrator@mail:~$ ps -ef | grep '/opt/zimbra' | grep "java" | grep -vi Funambol | grep -v "zmmailboxdmgr" | grep -v grep | awk '{print $1}' | head -n 1
You are not running Zimbra as root, so you just need to change the backup script, as shown above.

Last edited by LaFong; 10-06-2010 at 09:53 AM..
Reply With Quote
  #10 (permalink)  
Old 10-06-2010, 11:04 AM
Active Member
 
Posts: 47
Default

It worked!

Thank you both for helping me out here, it has been a really frustrating journey so far!
I am so happy! -And I have learned something to, which is a pleasant bonus!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.