Configure autostart for non-root/non-sudo Linux installations

6 minute readReference

Linux installations that you perform as a non-root user or without sudo permissions cannot automatically start the CloudBees CD/RO server, web server, repository server, or agents. This means that you must set up service autostart after installation is complete. This section describes how to set up autostart and also how to disable it if needed.

Setting up autostart

This section describes how to set up autostart of services for all CloudBees CD/RO components as follows:

Setting Up Autostart Services

  1. Provide a service control script in the /etc/init.d directory by using one of the following methods.

    <install_dir> is /opt/cloudbees/sda by default.
    • Secure (preferred) method:

      $ sudo cp -v <install_dir>/startup/commanderServer /etc/init.d/ef-user-server ‘<install_dir>/startup/commanderServer’ -> ‘/etc/init.d/ef-user-server’ $ sudo chown -v root:root /etc/init.d/ef-user-server ownership of ‘/etc/init.d/ef-user-server’ retained as root:root $ sudo chmod -v 0755 /etc/init.d/ef-user-server mode of ‘/etc/init.d/ef-user-server’ retained as 0755 (rwxr-xr-x)
    • Less secure (alternative) method:

      $ sudo ln -sv <install_dir>/startup/commanderServer /etc/init.d/ef-user-server '/etc/init.d/ef-user-server' -> '<install_dir>/startup/commanderServer'
  2. Create links in the “rc” directories.

    The exact commands as well as the prompts displayed in response will vary with the specific distribution. Following are several examples: ** RHEL 5. x , 6. x , or 7. x ; CentOS 5. x , 6. x , or 7. x ; SLES 11 or 12:

    +

    $ sudo /sbin/chkconfig --add ef-user-server $ sudo /sbin/chkconfig ef-user-server on
    • Ubuntu 14. x , 16. x , or 18. x :

      $ sudo /usr/sbin/update-rc.d ef-user-server defaults
      Adding system startup for /etc/init.d/ef-user-server ... /etc/rc0.d/K20ef-user-server -> ../init.d/ef-user-server /etc/rc1.d/K20ef-user-server -> ../init.d/ef-user-server /etc/rc6.d/K20ef-user-server -> ../init.d/ef-user-server /etc/rc2.d/S20ef-user-server -> ../init.d/ef-user-server /etc/rc3.d/S20ef-user-server -> ../init.d/ef-user-server /etc/rc4.d/S20ef-user-server -> ../init.d/ef-user-server /etc/rc5.d/S20ef-user-server -> ../init.d/ef-user-server

Setting Up Autostart for CloudBees CD/RO Web Server Services

  1. Provide a service control script in the /etc/init.d directory by using one of the following methods.

    <install_dir> is /opt/cloudbees/sda by default.
    • Secure (preferred) method:

      $ sudo cp -v <install_dir>/startup/commanderApache /etc/init.d/ef-user-apache ‘<install_dir>/startup/commanderApache’ -> ‘/etc/init.d/ef-user-apache’ $ sudo chown -v root:root /etc/init.d/ef-user-apache ownership of ‘/etc/init.d/ef-user-apache’ retained as root:root $ sudo chmod -v 0755 /etc/init.d/ef-user-apache mode of ‘/etc/init.d/ef-user-apache’ retained as 0755 (rwxr-xr-x)
    • Less secure (alternative) method:

      $ sudo ln -sv <install_dir>/startup/commanderApache /etc/init.d/ef-user-apache '/etc/init.d/ef-user-apache' -> '<install_dir>/startup/commanderApache'
  2. Create links in the “rc” directories.

    The exact commands as well as the prompts displayed in response will vary with the specific distribution. Following are several examples: ** RHEL 5. x , 6. x , or 7. x ; CentOS 5. x , 6. x , or 7. x ; SLES 11 or 12:

    +

    $ sudo /sbin/chkconfig --add ef-user-apache $ sudo /sbin/chkconfig ef-user-apache on
    • Ubuntu 14. x , 16. x , or 18. x :

      $ sudo /usr/sbin/update-rc.d ef-user-apache defaults
      Adding system startup for /etc/init.d/ef-user-apache ... /etc/rc0.d/K20ef-user-apache -> ../init.d/ef-user-apache /etc/rc1.d/K20ef-user-apache -> ../init.d/ef-user-apache /etc/rc6.d/K20ef-user-apache -> ../init.d/ef-user-apache /etc/rc2.d/S20ef-user-apache -> ../init.d/ef-user-apache /etc/rc3.d/S20ef-user-apache -> ../init.d/ef-user-apache /etc/rc4.d/S20ef-user-apache -> ../init.d/ef-user-apache /etc/rc5.d/S20ef-user-apache -> ../init.d/ef-user-apache

Setting Up Autostart for CloudBees CD/RO Repository Server Services

  1. Provide a service control script in the /etc/init.d directory by using one of the following methods.

    <install_dir> is /opt/cloudbees/sda by default.
    • Secure (preferred) method:

      $ sudo cp -v <install_dir>/startup/commanderRepository /etc/init.d/ef-user-repository ‘<install_dir>/startup/commanderRepository’ -> ‘/etc/init.d/ef-user-repository’ $ sudo chown -v root:root /etc/init.d/ef-user-repository ownership of ‘/etc/init.d/ef-user-repository’ retained as root:root $ sudo chmod -v 0755 /etc/init.d/ef-user-repository mode of ‘/etc/init.d/ef-user-repository’ retained as 0755 (rwxr-xr-x)
    • Less secure (alternative) method:

      $ sudo ln -sv <install_dir>/startup/commanderRepository /etc/init.d/ef-user-repository '/etc/init.d/ef-user-repository' -> '<install_dir>/startup/commanderRepository'
  2. Create links in the rc directories.

    The exact commands as well as the prompts displayed in response will vary with the specific distribution. Following are several examples:

    • RHEL 5. x , 6. x , or 7. x ; CentOS 5. x , 6. x , or 7. x ; SLES 11 or 12:

      $ sudo /sbin/chkconfig --add ef-user-repository $ sudo /sbin/chkconfig ef-user-repository on
    • Ubuntu 14. x , 16. x , or 18. x :

      $ sudo /usr/sbin/update-rc.d ef-user-repository defaults
      Adding system startup for /etc/init.d/ef-user-repository ... /etc/rc0.d/K20ef-user-repository -> ../init.d/ef-user-repository /etc/rc1.d/K20ef-user-repository -> ../init.d/ef-user-repository /etc/rc6.d/K20ef-user-repository -> ../init.d/ef-user-repository /etc/rc2.d/S20ef-user-repository -> ../init.d/ef-user-repository /etc/rc3.d/S20ef-user-repository -> ../init.d/ef-user-repository /etc/rc4.d/S20ef-user-repository -> ../init.d/ef-user-repository /etc/rc5.d/S20ef-user-repository -> ../init.d/ef-user-repository

Setting Up Autostart for CloudBees CD/RO Built-In Database Server Services

  1. Provide a service control script in the /etc/init.d directory by using one of the following methods.

    <install_dir> is /opt/cloudbees/sda by default.
    • Secure (preferred) method:

      $ sudo cp -v <install_dir>/startup/commanderDatabase /etc/init.d/ef-user-database ‘<install_dir>/startup/commanderDatabase’ -> ‘/etc/init.d/ef-user-database’ $ sudo chown -v root:root /etc/init.d/ef-user-database ownership of ‘/etc/init.d/ef-user-database’ retained as root:root $ sudo chmod -v 0755 /etc/init.d/ef-user-database mode of ‘/etc/init.d/ef-user-database’ retained as 0755 (rwxr-xr-x)
    • Less secure (alternative) method:

      $ sudo ln -sv <install_dir>/startup/commanderDatabase /etc/init.d/ef-user-database '/etc/init.d/ef-user-database' -> '<install_dir>/startup/commanderDatabase'
  2. Create links in the rc directories.

    The exact commands as well as the prompts displayed in response will vary with the specific distribution. Following are several examples:

    • RHEL 5. x , 6. x , or 7. x ; CentOS 5. x , 6. x , or 7. x ; SLES 11 or 12:

      $ sudo /sbin/chkconfig --add ef-user-database $ sudo /sbin/chkconfig ef-user-database on
    • Ubuntu 14. x , 16. x , or 18. x :

      $ sudo /usr/sbin/update-rc.d ef-user-database defaults
      Adding system startup for /etc/init.d/ef-user-database ... /etc/rc0.d/K20ef-user-database -> ../init.d/ef-user-database /etc/rc1.d/K20ef-user-database -> ../init.d/ef-user-database /etc/rc6.d/K20ef-user-database -> ../init.d/ef-user-database /etc/rc2.d/S20ef-user-database -> ../init.d/ef-user-database /etc/rc3.d/S20ef-user-database -> ../init.d/ef-user-database /etc/rc4.d/S20ef-user-database -> ../init.d/ef-user-database /etc/rc5.d/S20ef-user-database -> ../init.d/ef-user-database

Setting Up Autostart for CloudBees CD/RO Agent Services

  1. Provide a service control script in the /etc/init.d directory by using one of the following methods.

    <install_dir> is /opt/cloudbees/sda by default.
    • Secure (preferred) method:

      $ sudo cp -v <install_dir>/startup/commanderAgent /etc/init.d/ef-user-agent ‘<install_dir>/startup/commanderAgent’ -> ‘/etc/init.d/ef-user-agent’ $ sudo chown -v root:root /etc/init.d/ef-user-agent ownership of ‘/etc/init.d/ef-user-agent’ retained as root:root $ sudo chmod -v 0755 /etc/init.d/ef-user-agent mode of ‘/etc/init.d/ef-user-agent’ retained as 0755 (rwxr-xr-x)
    • Less secure (alternative) method:

      $ sudo ln -sv <install_dir>/startup/commanderAgent /etc/init.d/ef-user-agent '/etc/init.d/ef-user-agent' -> '<install_dir>/startup/commanderAgent'
  2. Create links in the rc directories.

    The exact commands as well as the prompts displayed in response will vary with the specific distribution. Following are several examples:

    • RHEL 5. x , 6. x , or 7. x ; CentOS 5. x , 6. x , or 7. x ; SLES 11 or 12:

      $ sudo /sbin/chkconfig --add ef-user-agent $ sudo /sbin/chkconfig ef-user-agent on
    • Ubuntu 14. x , 16. x , or 18. x :

      $ sudo /usr/sbin/update-rc.d ef-user-agent defaults
      Adding system startup for /etc/init.d/ef-user-agent ... /etc/rc0.d/K20ef-user-agent -> ../init.d/ef-user-agent /etc/rc1.d/K20ef-user-agent -> ../init.d/ef-user-agent /etc/rc6.d/K20ef-user-agent -> ../init.d/ef-user-agent /etc/rc2.d/S20ef-user-agent -> ../init.d/ef-user-agent /etc/rc3.d/S20ef-user-agent -> ../init.d/ef-user-agent /etc/rc4.d/S20ef-user-agent -> ../init.d/ef-user-agent /etc/rc5.d/S20ef-user-agent -> ../init.d/ef-user-agent

Setting Up Autostart for CloudBees Analytics Server Services

CloudBees Analytics requires autostart for OpenSearch. The CloudBees Analytics server uses the OpenSearch search engine to gather and store data from the CloudBees CD/RO server for use in the CloudBees Analytics dashboards such as the Deployments, Releases, and Release Command Center dashboards.

Setting Up Autostart for CloudBees Analytics

  1. Provide a service control script in the /etc/init.d directory by using one of the following methods.

    <install_dir> is /opt/cloudbees/sda by default.
    • Secure (preferred) method

      $ sudo cp -v <install_dir>/analytics/startup/commanderAnalytics /etc/init.d/ef-user-analytics ‘<install_dir>/analytics/startup/commanderAnalytics’ -> ‘/etc/init.d/ef-user-analytics’ $ sudo chown -v root:root /etc/init.d/ef-user-analytics ownership of ‘/etc/init.d/ef-user-analytics’ retained as root:root $ sudo chmod -v 0755 /etc/init.d/ef-user-analytics mode of ‘/etc/init.d/ef-user-analytics’ retained as 0755 (rwxr-xr-x)
    • Less secure (alternative) method:

      $ sudo ln -sv <install_dir>/analytics/startup/commanderAnalytics /etc/init.d/ef-user-analytics '/etc/init.d/ef-user-analytics' -> '<install_dir>/analytics/startup/commanderAnalytics'
  2. Create links in the rc directories.

    The exact commands as well as the prompts displayed in response will vary with the specific distribution. Following are several examples:

    • RHEL 5. x , 6. x , or 7. x ; CentOS 5. x , 6. x , or 7. x ; SLES 11 or 12:

      $ sudo /sbin/chkconfig --add ef-user-analytics $ sudo /sbin/chkconfig ef-user-analytics on
    • Ubuntu 14. x , 16. x , or 18. x :

      $ sudo /usr/sbin/update-rc.d ef-user-analytics defaults
      Adding system startup for /etc/init.d/ef-user-analytics ... /etc/rc0.d/K20ef-user-analytics -> ../init.d/ef-user-analytics /etc/rc1.d/K20ef-user-analytics -> ../init.d/ef-user-analytics /etc/rc6.d/K20ef-user-analytics -> ../init.d/ef-user-analytics /etc/rc2.d/S20ef-user-analytics -> ../init.d/ef-user-analytics /etc/rc3.d/S20ef-user-analytics -> ../init.d/ef-user-analytics /etc/rc4.d/S20ef-user-analytics -> ../init.d/ef-user-analytics /etc/rc5.d/S20ef-user-analytics -> ../init.d/ef-user-analytics

Disabling Services Autostart

This section describes how to disable autostart of services for all CloudBees CD/RO components as follows:

Disabling Autostart for CloudBees CD/RO Server Services

Enter the following command:

$ sudo rm -fv /etc/init.d/ef-user-server /etc/rc?.d/*ef-user-server /etc/init.d/rc?.d/*ef-user-server removed ‘/etc/init.d/ef-user-server’removed ‘/etc/rc0.d/K20ef-user-server’removed ‘/etc/rc1.d/K20ef-user-server’removed ‘/etc/rc2.d/S20ef-user-server’removed ‘/etc/rc3.d/S20ef-user-server’removed ‘/etc/rc4.d/S20ef-user-server’removed ‘/etc/rc5.d/S20ef-user-server’removed ‘/etc/rc6.d/K20ef-user-server’

The prompts displayed in response to these commands might vary with the specific distribution and version.

Disabling Autostart for CloudBees CD/RO Web Server Services

Enter the following command:

$ sudo rm -fv /etc/init.d/ef-user-apache /etc/rc?.d/*ef-user-apache /etc/init.d/rc?.d/*ef-user-apache removed ‘/etc/init.d/ef-user-apache’removed ‘/etc/rc0.d/K20ef-user-apache’removed ‘/etc/rc1.d/K20ef-user-apache’removed ‘/etc/rc2.d/S20ef-user-apache’removed ‘/etc/rc3.d/S20ef-user-apache’removed ‘/etc/rc4.d/S20ef-user-apache’removed ‘/etc/rc5.d/S20ef-user-apache’removed ‘/etc/rc6.d/K20ef-user-apache’

The prompts displayed in response to these commands might vary with the specific distribution and version.

Disabling Autostart for CloudBees CD/RO Repository Server Services

Enter the following command:

$ sudo rm -fv /etc/init.d/ef-user-repository /etc/rc?.d/*ef-user-repository /etc/init.d/rc?.d/*ef-user-repository removed ‘/etc/init.d/ef-user-repository’removed ‘/etc/rc0.d/K20ef-user-repository’removed ‘/etc/rc1.d/K20ef-user-repository’removed ‘/etc/rc2.d/S20ef-user-repository’removed ‘/etc/rc3.d/S20ef-user-repository’removed ‘/etc/rc4.d/S20ef-user-repository’removed ‘/etc/rc5.d/S20ef-user-repository’removed ‘/etc/rc6.d/K20ef-user-repository’

The prompts displayed in response to these commands might vary with the specific distribution and version.

Disabling Autostart for CloudBees CD/RO Built-In Database Server Services

Enter the following command:

$ sudo rm -fv /etc/init.d/ef-user-database /etc/rc?.d/*ef-user-database /etc/init.d/rc?.d/*ef-user-database removed ‘/etc/init.d/ef-user-database’removed ‘/etc/rc0.d/K20ef-user-database’removed ‘/etc/rc1.d/K20ef-user-database’removed ‘/etc/rc2.d/S20ef-user-database’removed ‘/etc/rc3.d/S20ef-user-database’removed ‘/etc/rc4.d/S20ef-user-database’removed ‘/etc/rc5.d/S20ef-user-database’removed ‘/etc/rc6.d/K20ef-user-database’

The prompts displayed in response to these commands might vary with the specific distribution and version.

Disabling Autostart for CloudBees CD/RO Agent Services

Enter the following command:

$ sudo rm -fv /etc/init.d/ef-user-agent /etc/rc?.d/*ef-user-agent /etc/init.d/rc?.d/*ef-user-agent removed ‘/etc/init.d/ef-user-agent’removed ‘/etc/rc0.d/K20ef-user-agent’removed ‘/etc/rc1.d/K20ef-user-agent’removed ‘/etc/rc2.d/S20ef-user-agent’removed ‘/etc/rc3.d/S20ef-user-agent’removed ‘/etc/rc4.d/S20ef-user-agent’removed ‘/etc/rc5.d/S20ef-user-agent’removed ‘/etc/rc6.d/K20ef-user-agent’

The prompts displayed in response to these commands might vary with the specific distribution and version.

Disabling Autostart for CloudBees Analytics Server Services

Enter the following command:

$ sudo rm -fv /etc/init.d/ef-user-analytics /etc/rc?.d/*ef-user-analytics /etc/init.d/rc?.d/*ef-user-analytics removed ‘/etc/init.d/ef-user-analytics’removed ‘/etc/rc0.d/K20ef-user-analytics’removed ‘/etc/rc1.d/K20ef-user-analytics’removed ‘/etc/rc2.d/S20ef-user-analytics’removed ‘/etc/rc3.d/S20ef-user-analytics’removed ‘/etc/rc4.d/S20ef-user-analytics’removed ‘/etc/rc5.d/S20ef-user-analytics’removed ‘/etc/rc6.d/K20ef-user-analytics’

The prompts displayed in response to these commands might vary with the specific distribution and version.