Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-17483

Zabbix services cannot access PID file, cannot create folder

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • 5.2 (plan)
    • 4.4.5, 4.4.6
    • Packages (C)
    • None
    • Oracle Linux 7, CIS hardening policy applied
    • Sprint 63 (Apr 2020), Sprint 64 (May 2020), Sprint 65 (Jun 2020), Sprint 66 (Jul 2020), Sprint 67 (Aug 2020), Sprint 68 (Sep 2020)
    • 0.5

      Problems started with OracleLinux7 - ol7 (RHEL basically), services weren't able to start with error, that PID folder/file location does not exist. I've been figuring this issue for quite some time. As there are few that are similar. It seems that service does not have rights to create 

      I've figured to make it work, by editing /lib/systemd/system/zabbix-proxy.service
      Default zabbix-proxy.service file:

      [Unit]
      Description=Zabbix Proxy
      After=syslog.target
      After=network.target
      After=mysql.service
      After=mysqld.service
      After=mariadb.service
      After=postgresql.service[Service]
      Environment="CONFFILE=/etc/zabbix/zabbix_proxy.conf"
      EnvironmentFile=-/etc/sysconfig/zabbix-proxy
      Type=forking
      Restart=on-failure
      PIDFile=/run/zabbix/zabbix_proxy.pid
      KillMode=control-group
      ExecStart=/usr/sbin/zabbix_proxy -c $CONFFILE
      ExecStop=/bin/kill -SIGTERM $MAINPID
      RestartSec=10s
      TimeoutSec=0[Install]
      WantedBy=multi-user.target
      

      What works for me (adding RuntimeDirectory and RuntimeDirectoryMode

      [Unit]
      Description=Zabbix Proxy
      After=syslog.target
      After=network.target
      After=mysql.service
      After=mysqld.service
      After=mariadb.service
      After=postgresql.service
      
      [Service]
      PermissionsStartOnly=True
      User=zabbix
      Group=zabbix
      RuntimeDirectory=zabbix
      RuntimeDirectoryMode=0755
      Environment="CONFFILE=/etc/zabbix/zabbix_proxy.conf" EnvironmentFile=-/etc/sysconfig/zabbix-proxy
      Type=forking
      Restart=on-failure
      PIDFile=/run/zabbix/zabbix_proxy.pid
      KillMode=control-group
      ExecStart=/usr/sbin/zabbix_proxy -c $CONFFILE
      ExecStop=/bin/kill -SIGTERM $MAINPID RestartSec=10s TimeoutSec=0
      
      [Install]
      WantedBy=multi-user.target
      

      Otherwise, service is not able to create zabbix folder in /run/ (/var/run/)

       

       

            yurii Jurijs Klopovskis
            mkotras Matej Kotras
            Team I
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: