Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Agent autostart on CentOS 7 not working #3829

tardis4500 ·

I ran the ./agent.sh install on a CentOS 6 and CentOS 7 servers but the agent does not start on reboot on the CentOS 7 server. I know that CentOS 7 uses "systemctl" instead of "service" to control service so it may be related to this change.

  • replies 12
  • views 1684
  • stars 0
robinshen ADMIN ·

Which QB version are you using?

tardis4500 ·

I am currently using 7.0.14.

robinshen ADMIN ·

Just set up a brand new minimum CentOS7, and agent auto-start works. Please make sure to edit agent.sh to uncomment RUN_AS_USER and set the value as the user running QB agent process. The user should be owner of agent's installation directory, and it has all privileges over all files inside it. If it does not work, please check "logs/console.log" to see if there are any error messages there.

tardis4500 ·

I have done all that but it doesn't some up at boot time. I have verified it is installed and is listed by chkconfig --list. I am able to start it with "services quickbuild start"

robinshen ADMIN ·

Does the console log contain any error messages?

tardis4500 ·

There are no messages at all in the console log. It is as though there is no attempt to start it.

robinshen ADMIN ·

Does /etc/init.d contain a file "quickbuild" which is a symbol link to "/path/to/qb_dir/bin/agent.sh"?

tardis4500 ·

Yes, and as I indicated, using the service command properly controls the service (i.e. service quickbuild start).

robinshen ADMIN ·

Looks like there is something wrong with your CentOS setup. Can you please test with some other software (such as Tomcat) to see if it can auto-start under the same user if installed as service?

tardis4500 ·

I think the problem is that CentOS 7 uses systemd instead of the old sysv init.d. What this means is that some of the mounts are happening after systemd tries to initiate the sysv init.d scripts. Since our QuickBuild install is located on a directory other than the root partition it isn't available when systemd tries to start the service and so it disables the QuickBuild service. Here's how to reproduce:

  1. Add a new disk to your CentOS installation (i.e. /home2)
  2. Create the quickbuild user on this drive (adduser -d /home2/quickbuild quickbuild)
  3. Put the agent under this user space (in /home2/quickbuild/buildagent)
  4. Run the install script (cd /home2/quickbuild/buildagent/bin; ./agent.sh install)
  5. Reboot
    Note that the service is not started and systemd doesn't know about it anymore:
    systemctl status quickbuild yields: "Unit quickbuild.service could not be found."
robinshen ADMIN ·

Thanks for the info. Please check "bin/agent.sh" to see if it has "USE_SYSTEMD=" flag, if yes, specify the value as 1 and then re-install the service. If it does not have that flag, please upgrade to QB server 7.0.23, and then re-install QB agent by downloading the agent package from updated QB server. Latest version of agent package will auto-detect availability of systemd and use it if available.

tardis4500 ·

Setting that flag worked. Thanks!