Ad Widget

Collapse

Can't open PID file /run/zabbix/zabbix_agentd.pid (yet?) after start...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mspoto
    Junior Member
    • Jun 2020
    • 3

    #1

    Can't open PID file /run/zabbix/zabbix_agentd.pid (yet?) after start...

    Operating System: CentOS Linux 7 (Core)
    Kernel: Linux 3.10.0-1127.13.1.el7.x86_64
    Architecture: x86-64

    sudo systemctl status zabbix-agent

    zabbix-agent.service - Zabbix Agent
    Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; enabled; vendor preset: disabled)
    Active: active (running) since Sun 2020-07-12 08:40:54 UTC; 4min 35s ago
    Main PID: 8902 (zabbix_agentd)
    CGroup: /system.slice/zabbix-agent.service
    ├─8902 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
    ├─8903 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
    ├─8904 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection
    ├─8905 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection
    ├─8906 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection
    └─8907 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]

    Jul 12 08:40:54 02serv.mastassociati.com systemd[1]: Stopped Zabbix Agent.
    Jul 12 08:40:54 02serv.mastassociati.com systemd[1]: Starting Zabbix Agent...
    Jul 12 08:40:54 02serv.mastassociati.com systemd[1]: Can't open PID file /run/zabbix/zabbix_agentd.pid (yet?) after start: No such file or directory
    Jul 12 08:40:54 02serv.mastassociati.com systemd[1]: Started Zabbix Agent.

    the file zabbix_agentd.pid is in /run/zabbix/

    # ls /run/zabbix/ -al
    total 4
    drwxr-xr-x 2 zabbix zabbix 60 Jul 12 08:40 .
    drwxr-xr-x 27 root root 840 Jul 12 08:33 ..
    -rw-rw-r-- 1 zabbix zabbix 4 Jul 12 08:40 zabbix_agentd.pid
  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #2
    You reported a lot of useful information, but you didn't include what version of Zabbix you're using and whether it's from official packages, direct from source, etc.

    I see the same issue, and others that have reported unrelated problems that have included systemctl output often have the same message. It seems like it's a bug in their systemctl service definition file, but I haven't looked into what the fix might be.

    Comment


    • mspoto
      mspoto commented
      Editing a comment
      Hy tim.mooney

      I using "Zabbix 5.0 LTS"
      and used this link "https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm"

      About installation:

      rpm -Uvh https://repo.zabbix.com/zabbix/5.0/r...el7.noarch.rpm
      yum clean all

      yum install zabbix-agent
  • ñull
    Junior Member
    • Dec 2020
    • 3

    #3
    Same version but now under Ubuntu 20.04LTS, I see the same issue. Is there already a fix?

    Comment

    • samarcos
      Junior Member
      • May 2021
      • 17

      #4
      I am getting the same issue with Ubuntu 18.04,
      Any fixes?
      looked everywhere and nothing

      Comment

      • marianogedisman
        Member
        • Oct 2021
        • 78

        #5
        Getting the same error on Debian10 on Google Cloud. Anyone still watching this thread?

        Code:
        ● zabbix-server.service - Zabbix Server
        
        Loaded: loaded (/lib/systemd/system/zabbix-server.service; enabled; vendor preset: enabled)
        
        Active: activating (start) since Mon 2021-10-25 00:07:29 UTC; 21min ago
        
        Process: 1248 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
        
        Tasks: 0 (limit: 609)
        
        Memory: 284.0K
        
        CGroup: /system.slice/zabbix-server.service
        
        
        
        
        Oct 25 00:07:29 zabbix systemd[1]: Starting Zabbix Server...
        
        Oct 25 00:07:29 zabbix systemd[1]: zabbix-server.service: Can't open PID file /run/zabbix/zabbix_server.pid (yet?) after start: No such file
        
        Oct 25 00:07:29 zabbix zabbix_server[1248]: zabbix_server [1250]: cannot open "/var/log/zabbix-server/zabbix_server.log": [13] Permission den
        
        lines 1-11/11 (END)

        Comment

        • marianogedisman
          Member
          • Oct 2021
          • 78

          #6
          Originally posted by cyber
          Some permission issues along the path? For logfile it is even saying that "Permission denied"...
          Hello cyber! Thanks a lot for chipping in. Yes, I noticed the second error. I was also a bit more worried about the first one: „
          Code:
          Oct 25 00:07:29 zabbix systemd[1]: zabbix-server.service: Can't open PID file /run/zabbix/zabbix_server.pid (yet?) after start: No such file


          Where can I get the file to put it in the corresponding directory?

          Thanks in advance!

          Comment

          • Atsushi
            Senior Member
            • Aug 2013
            • 2028

            #7
            The first question is, in the command output described, it seems that the startup was successful after the error message output. When you check the status with the systemctl command, several lines of past logs are displayed, so it is necessary to check whether the service is currently running. Did you mistakenly judge that it was an error by looking at the past logs?

            Check the following items to see if the service is running.
            - Existence of processes using the ps command
            - Active and running in the output of the systemctl status command
            - Is it stuck with an error at the last line of the agent log file?
            - The existence in the PID file matches the PID of the agent whose contents are running

            Immediately after installing the package, there is no directory and an error occurs, but if it is immediately recovered by settings and functions such as systemd and the service is started, there is no problem.

            Comment

            • ñull
              Junior Member
              • Dec 2020
              • 3

              #8
              Originally posted by Atsushi
              The first question is, in the command output described, it seems that the startup was successful after the error message output.
              Yes it is succesful. ps processes exist and are the same that systemctl status lists. No error at the end of the log file and the PID in /run/zabbix/zabbix_agentd.pid matches with the one that systemctl status lists as the first. So in my case the warning or error message does not affect the functionality. May be an error in the start script?

              Comment

              • cyber
                Senior Member
                Zabbix Certified SpecialistZabbix Certified Professional
                • Dec 2006
                • 4807

                #9
                Some permission issues along the path? For logfile it is even saying that "Permission denied"...

                Comment

                • cyber
                  Senior Member
                  Zabbix Certified SpecialistZabbix Certified Professional
                  • Dec 2006
                  • 4807

                  #10
                  pid file is just a file where process number is stored (in this case zabbix_server main process). it is created automatically during startup. If it fails to do so, then there might be permission issues along the path and user zabbix is not able to create that file.

                  Comment

                  • madeforyalo
                    Junior Member
                    • Oct 2022
                    • 1

                    #11
                    buenos días, estimados.

                    comparto con ustedes lo que hice para solucionar este problema

                    lo que note fue que el directorio /run/zabbix no existía, y mucho menos el archivo zabbix_agentd.pid

                    ​asi que la forma que tuve de solucionarlo fue crear ese directorio y archivo:

                    cd /run

                    mkdir zabbix

                    cd zabbix

                    touch zabbix_agentd.pid

                    cd ..

                    chown -R zabbix:zabbix zabbix/

                    systemctl restart zabbix-agent


                    con eso fue mas que suficiente. No sé la razón por la que en primer lugar desapareció ese directorio, pero con esos pasos mi zabbix ya anda correctamente.
                    espero que les sirva.

                    Saludos.

                    Comment

                    • zigzag
                      Junior Member
                      • Oct 2010
                      • 2

                      #12
                      I have to in /etc/zabbix/zabbix_agentd.conf enable PidFile=/var/run/zabbix/zabbix_agentd.pid

                      Comment

                      • LenR
                        Senior Member
                        • Sep 2009
                        • 1005

                        #13
                        I think this is an issue I'm seeing a lot. If the symptoms are that zabbix works after install, then gets this error after a reboot? If so, here is what I've done to fix and what I think is the cause:

                        /run has to tmpfs in recent yeares. Zabbix creates /var/run/zabbix at install, so the first start works. After system reboot, tmpfs is gone, so this error.

                        I've done systemctl edit zabbix-<whichever> and added RuntimeDirectory​=/var/run/zabbix

                        NOTE that on my systems, /var/run is a symlink to /run (or the other way around) so it's really the same place.

                        Another method is to add a /usr/lib/tmpfiles.d/ config

                        Comment

                        • ouarit
                          Junior Member
                          • Jul 2024
                          • 1

                          #14
                          I checked the path on my /etc/zabbix/zabbix_proxy.conf

                          it was on /run/zabbix/zabbix_proxy.pid

                          In my case, I made the next steps
                          Code:
                          mkdir /run/zabbix
                          touch /run/zabbix/zabbix_proxy.pid
                          
                          chown -R zabbix:zabbix /run/zabbix
                          systemctl restart zabbix-proxy
                          And it works for me.

                          Code:
                          ● zabbix-proxy.service - Zabbix Proxy
                             Loaded: loaded (/usr/lib/systemd/system/zabbix-proxy.service; enabled; vendor preset: disabled)
                             Active: active (running) since Tue 2024-07-02 10:16:20 CST; 6min ago
                            Process: 3259 ExecStart=/usr/sbin/zabbix_proxy -c $CONFFILE (code=exited, status=0/SUCCESS

                          Comment

                          Working...