Ad Widget

Collapse

/etc/init.d/zabbix_server start VS services zabbix_server start

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Air-zone
    Junior Member
    • May 2015
    • 3

    #1

    /etc/init.d/zabbix_server start VS services zabbix_server start

    hi everyone.
    i've got a problem here.
    when i start zabbix server like this:
    Code:
    /etc/init.d/zabbix_server start
    everithing goes fine.
    BUT
    if i start zabbix server like this:
    Code:
    service zabbix_server start
    i've got a database connection error, and zabbix server does not start:
    Code:
    [z3001] connection to database failed: [-1]
    what am i doing wrong?
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    If you use the service command, not inherited, such as environment variables.

    Please check whether you are using environment variables, such as the need to connect to the database.

    If necessary to set the environment variable, please try to be explicitly specified in the init script.

    Comment

    • Air-zone
      Junior Member
      • May 2015
      • 3

      #3
      i run both commands under root user

      Originally posted by Atsushi
      If necessary to set the environment variable, please try to be explicitly specified in the init script.
      do you mean that i have to define database specific environment variables in zabbix_server config file?

      Comment

      • Atsushi
        Senior Member
        • Aug 2013
        • 2028

        #4
        Two ways that is the process of start-up procedure is different.
        You have to define database specific environment variables in /etc/init.d/zabbix_server.

        Comment

        • Air-zone
          Junior Member
          • May 2015
          • 3

          #5
          Originally posted by Atsushi
          Two ways that is the process of start-up procedure is different.
          You have to define database specific environment variables in /etc/init.d/zabbix_server.
          i added db environment vars in /etc/init.d/zabbix_server and it worked!
          thank you Atsushi! you solved my problem!

          Comment

          Working...