Ad Widget

Collapse

Zabbix server wont start. Can't create pid file.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • phoeneous
    Member
    • Nov 2010
    • 32

    #1

    Zabbix server wont start. Can't create pid file.

    New install of Zabbix 2.0.4 on CentOS 6.3 from yum packages (epel repo). All seemed to be working well until I had to reboot the server. Now the zabbix-server daemon wont start, I assume because zabbix_server.pid cannot be created for whatever reason.

    [root@server zabbix]#service zabbix-server start
    Starting Zabbix server:[ OK zabbix_server [3108]: cannot open [/var/log/zabbix/zabbix_server.log]: [13] Permission denied
    From the log file /var/log/zabbix_server.log
    zabbix_server [2959]: cannot create PID file [/var/run/zabbix/zabbix_server.pid]: [13] Permission denied
    [root@server zabbix]# pwd
    /var/run/zabbix
    [root@server zabbix]# ls -la
    total 12
    drwxrwxr-x. 2 zabbix zabbix 4096 Jan 26 05:16 .
    drwxr-xr-x. 32 root root 4096 Jan 26 05:16 ..
    -rw-rw-r-- 1 zabbix zabbix 4 Jan 26 05:16 zabbix_agentd.pid
    [root@server zabbix]#


    [root@server zabbix]# pwd
    /var/log/zabbix
    [root@server zabbix]# ls -la
    total 72
    drwxrwxr-x. 2 zabbix zabbix 4096 Dec 8 05:40 .
    drwxr-xr-x. 15 root root 4096 Jan 26 05:16 ..
    -rwxrwxrwx 1 zabbix zabbix 4322 Jan 26 05:16 zabbix_agentd.log
    -rw-rw-r--. 1 zabbix zabbix 51870 Jan 26 05:41 zabbix_server.log
    [root@server zabbix]#


    [root@server zabbix]# ps -A | grep zabbix
    2145 ? 00:00:00 zabbix_agentd
    2156 ? 00:00:00 zabbix_agentd
    2157 ? 00:00:00 zabbix_agentd
    2158 ? 00:00:00 zabbix_agentd
    2159 ? 00:00:00 zabbix_agentd
    2160 ? 00:00:00 zabbix_agentd
    [root@server zabbix]#
    From /etc/zabbix/zabbix_server.conf
    ### Option: PidFile
    # Name of PID file.
    #
    # Mandatory: no
    # Default:
    PidFile=/var/run/zabbix/zabbix_server.pid
    Last edited by phoeneous; 26-01-2013, 23:10.
  • Fullmetal8ender
    Member
    • Nov 2012
    • 81

    #2
    zabbix say "cannot open /var/log/zabbix/zabbix_server.log"
    and you read /var/log/zabbix_server.log.
    They're not the same!
    If zabbix cannot open file, it would not be able to write error in this file, so i think the reason is in /var/log/zabbix/zabbix_server.log permission.

    Why server name is different in
    [root@server zabbix]# pwd
    and
    [root@gjlsrvlvsnmp1 zabbix]# ls -la ?
    Is it 1 server "server" or two servers "server" and "gjlsrvlvsnmp1"?

    Check "Option: LogFile" in zabbix_server.conf and permission once again.

    Maybe file is open and blocked in other program? Try to move it.

    ЗЫ sorry for my bad English

    Comment

    • f.koch
      Member
      Zabbix Certified Specialist
      • Feb 2010
      • 85

      #3
      do you install zabbix from the epel repo?

      if you do, run these commands and try starting again

      Code:
      chown root:zabbixsrv /var/run/zabbix/zabbix_server.pid
      chown root:zabbixsrv /var/log/zabbix/zabbix_server.log
      Last edited by f.koch; 26-01-2013, 18:00.

      Comment

      • phoeneous
        Member
        • Nov 2010
        • 32

        #4
        Originally posted by Fullmetal8ender
        zabbix say "cannot open /var/log/zabbix/zabbix_server.log"
        and you read /var/log/zabbix_server.log.
        They're not the same!
        If zabbix cannot open file, it would not be able to write error in this file, so i think the reason is in /var/log/zabbix/zabbix_server.log permission.
        I know theyre not the same, it was a typo.

        I posted both /var/run/zabbix and /var/log/zabbix from same server.
        Last edited by phoeneous; 26-01-2013, 23:09.

        Comment

        • phoeneous
          Member
          • Nov 2010
          • 32

          #5
          Originally posted by f.koch
          do you install zabbix from the epel repo?

          if you do, run these commands and try starting again

          Code:
          chown root:zabbixsrv /var/run/zabbix/zabbix_server.pid
          chown root:zabbixsrv /var/log/zabbix/zabbix_server.log
          Yes, from epel repo. I will try this suggestion.

          Is the group zabbixsrv supposed to already exist? I didn't see anywhere in documentation to create it.


          EDIT

          I ran:

          Code:
          chown root:zabbixsrv /var/run/zabbix/zabbix_server.pid
          chown root:zabbixsrv /var/log/zabbix/zabbix_server.log
          And still get:

          Code:
          [root@server zabbix]#service zabbix-server start
          Starting Zabbix server:[ OK zabbix_server [2549]: cannot open [/var/log/zabbix/zabbix_server.log]: [13] Permission denied
          Last edited by phoeneous; 26-01-2013, 21:02.

          Comment

          • f.koch
            Member
            Zabbix Certified Specialist
            • Feb 2010
            • 85

            #6
            can you show

            Code:
             ls -l /var/log
            and

            Code:
             egrep zabbixsrv /etc/group
            Last edited by f.koch; 26-01-2013, 22:09.

            Comment

            • phoeneous
              Member
              • Nov 2010
              • 32

              #7
              Originally posted by f.koch
              can you show

              Code:
               ls -l /var/log
              and

              Code:
               egrep zabbixsrv /etc/group
              See below.

              [root@server /]# ls -la var/log
              total 2200
              drwxr-xr-x. 15 root root 4096 Jan 26 10:52 .
              drwxr-xr-x. 22 root root 4096 Jan 24 10:11 ..
              -rw-------. 1 root root 5467 Jan 24 10:16 anaconda.ifcfg.log
              -rw-------. 1 root root 22670 Jan 24 10:16 anaconda.log
              -rw-------. 1 root root 99455 Jan 24 10:16 anaconda.program.log
              -rw-------. 1 root root 236855 Jan 24 10:16 anaconda.storage.log
              -rw-------. 1 root root 80665 Jan 24 10:16 anaconda.syslog
              -rw-------. 1 root root 27431 Jan 24 10:16 anaconda.xlog
              -rw-------. 1 root root 113387 Jan 24 10:16 anaconda.yum.log
              drwxr-x---. 2 root root 4096 Jan 25 14:43 audit
              -rw-r--r-- 1 root root 3011 Jan 26 10:52 boot.log
              -rw-------. 1 root utmp 1920 Jan 26 04:44 btmp
              drwxr-xr-x. 2 root root 4096 Jan 24 10:31 ConsoleKit
              -rw-------. 1 root root 44840 Jan 26 12:40 cron
              drwxr-xr-x. 2 lp sys 4096 Nov 20 16:09 cups
              -rw-r--r-- 1 root root 43462 Jan 26 10:51 dmesg
              -rw-r--r-- 1 root root 43462 Jan 26 05:16 dmesg.old
              -rw-r--r--. 1 root root 229707 Jan 24 11:34 dracut.log
              drwxrwx--T. 2 root gdm 4096 Jan 26 10:52 gdm
              drwx------. 2 root root 4096 Jan 24 12:02 httpd
              -rw-r--r--. 1 root root 145708 Jan 26 10:56 lastlog
              -rw-------. 1 root root 4595 Jan 26 10:52 maillog
              -rw-------. 1 root root 803359 Jan 26 12:01 messages
              -rw-r-----. 1 mysql mysql 29292 Jan 26 10:52 mysqld.log
              drwxr-xr-x. 2 ntp ntp 4096 Nov 28 2011 ntpstats
              -rw-r--r--. 1 root root 89 Jan 26 10:52 pm-powersave.log
              drwx------. 2 root root 4096 Aug 22 2010 ppp
              drwxr-xr-x. 2 root root 4096 Jan 24 11:10 prelink
              drwxr-xr-x. 2 root root 4096 Jan 26 00:00 sa
              drwx------. 3 root root 4096 Jan 24 10:05 samba
              -rw-------. 1 root root 46024 Jan 26 11:00 secure
              drwxr-xr-x. 2 root root 4096 Dec 7 2011 spice-vdagentd
              -rw-------. 1 root root 0 Jan 24 10:05 spooler
              drwxr-x---. 2 root root 4096 Jun 22 2012 sssd
              -rw-------. 1 root root 0 Jan 24 09:59 tallylog
              -rw-r--r--. 1 root root 0 Jan 24 10:18 wpa_supplicant.log
              -rw-rw-r--. 1 root utmp 72960 Jan 26 10:56 wtmp
              -rw-r--r-- 1 root root 38666 Jan 26 10:52 Xorg.0.log
              -rw-r--r-- 1 root root 40581 Jan 26 10:51 Xorg.0.log.old
              -rw-r--r--. 1 root root 60315 Jan 25 15:07 Xorg.1.log
              -rw-r--r--. 1 root root 26663 Jan 24 10:29 Xorg.9.log
              -rw-------. 1 root root 12291 Jan 26 04:50 yum.log
              drwxrwxr-x. 2 root zabbixsrv 4096 Dec 8 05:40 zabbix

              [root@server /]# egrep zabbixsrv /etc/group
              zabbixsrv:x:502:root,zabbix
              [root@server /]#

              Comment

              • f.koch
                Member
                Zabbix Certified Specialist
                • Feb 2010
                • 85

                #8
                ok please

                Code:
                ls -l /var/log/zabbix
                Code:
                sestatus
                Last edited by f.koch; 26-01-2013, 23:12.

                Comment

                • phoeneous
                  Member
                  • Nov 2010
                  • 32

                  #9
                  Originally posted by f.koch
                  ok please

                  Code:
                  ls -l /var/log/zabbix
                  Code:
                  sestatus
                  See below. I disabled selinux earlier during my troubleshooting.

                  [root@server /]# ls -la /var/log/zabbix
                  total 72
                  drwxrwxr-x. 2 root zabbixsrv 4096 Dec 8 05:40 .
                  drwxr-xr-x. 15 root root 4096 Jan 26 10:52 ..
                  -rwxrwxrwx 1 root zabbixsrv 5424 Jan 26 10:52 zabbix_agentd.log
                  -rw-rw-r--. 1 root zabbixsrv 51870 Jan 26 05:41 zabbix_server.log
                  [root@server /]# sestatus
                  SELinux status: disabled
                  Also just noticed this:

                  [zabbix@server /]$ ./etc/init.d/zabbix-server start
                  Starting Zabbix server: runuser: cannot set groups: Operation not permitted
                  [FAILED]
                  Last edited by phoeneous; 27-01-2013, 00:09.

                  Comment

                  • f.koch
                    Member
                    Zabbix Certified Specialist
                    • Feb 2010
                    • 85

                    #10
                    have you modified the permissions of /var/log after the installation , except my chown suggestion?

                    [zabbix@server /]$ ./etc/init.d/zabbix-server start
                    Starting Zabbix server: runuser: cannot set groups: Operation not permitted
                    [FAILED]
                    you are not root

                    ok and my chown suggestion is not correct, sorry, the correct one is
                    Code:
                    chown -R zabbix:zabbix /var/log/zabbix
                    chown -R zabbix:zabbix /var/run/zabbix
                    chmod -R 775 /var/log/zabbix/
                    chmod -R 775 /var/run/zabbix/
                    and try to remove zabbix-server, and install again
                    Last edited by f.koch; 27-01-2013, 00:23.

                    Comment

                    • phoeneous
                      Member
                      • Nov 2010
                      • 32

                      #11
                      Originally posted by f.koch
                      have you modified the permissions of /var/log after the installation , except my chown suggestion?



                      you are not root

                      ok and my chown suggestion is not correct, sorry, the correct one is
                      Code:
                      chown -R zabbix:zabbix /var/log/zabbix
                      chown -R zabbix:zabbix /var/run/zabbix
                      chmod -R 775 /var/log/zabbix/
                      chmod -R 775 /var/run/zabbix/
                      and try to remove zabbix-server, and install again
                      Before your suggestions, I only made chown changes to fping per the manual.

                      Should I only remove zabbix-server related packages or all of these?

                      zabbix20.x86_64 2.0.4-1.el6 @epel
                      zabbix20-agent.x86_64 2.0.4-1.el6 @epel
                      zabbix20-server.x86_64
                      zabbix20-server-mysql.x86_64
                      zabbix20-web.noarch 2.0.4-1.el6 @epel
                      zabbix20-web-mysql.noarch

                      Comment

                      • f.koch
                        Member
                        Zabbix Certified Specialist
                        • Feb 2010
                        • 85

                        #12
                        you can remove all

                        Comment

                        • phoeneous
                          Member
                          • Nov 2010
                          • 32

                          #13
                          I ended up removing all zabbix packages, deleting every directory and file related to zabbix, dropping zabbix database, then starting from scratch...

                          Thanks for your help though.

                          Comment

                          • DanielB
                            Junior Member
                            • Jun 2017
                            • 3

                            #14
                            Originally posted by phoeneous
                            I ended up removing all zabbix packages, deleting every directory and file related to zabbix, dropping zabbix database, then starting from scratch...

                            Thanks for your help though.
                            Sorry for re-open an old thread, but if anyone have this issue, this is the solution:

                            I have had the same problem than you. I have updated and after reboot zabbix-server didn't start. The problem is SELinux, so you have 2 options:

                            1- Put SELinux in "Permissive" mode using setenforce 0 (only for running state) or edit the /etc/selinux/config and change the mode from enforcing to permissive (persists after reboots).
                            2- Use sealert in /var/log/audit/audit.log or /var/log/messages and check the way to fix it (the same tool let you know how to fix it).

                            In my case i set selinux in permissive mode (because is a lab environment) and everything works fine now.

                            Comment

                            Working...