Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-56186

Confluence doesn't get installed as a service even when the installer is run as root in Ubuntu

      Summary

      According to the guide of installing Confluence on Linux Server, if the installer is run as root, Confluence will be installed as a service. Although, it doesn't get installed as a service on Ubuntu.

      Testing Environment

      Ubuntu 18.04 LTS
      Confluence installer 6.10.1

      Steps to reproduce

      1. Download installer of Confluence.
      2. Add the execute flag to the installer.
      3. Run the installer as root.

      Expected Results

      Confluence should be installed as a service.

      Actual Result

      Confluence doesn't get installed as a service.

      Workaround

      Installer does create the /etc/init.d/confluence file, though it doesn't have the run levels in it.
      So, if we will directly enable the service, Ubuntu throws an error.

      update-rc.d: error: confluence Default-Start contains no runlevels, aborting.
      

      We need to add the following lines on the top of /etc/init.d/confluence file, but after the shebang.

      ### BEGIN INIT INFO
      # Required-Start:    $all
      # Required-Stop:
      # Default-Start:     2 3 4 5
      # Default-Stop:
      ### END INIT INFO
      

      After the above change, run the following command again to install Confluence as a service.

      systemctl enable confluence
      

      Diagnosis

      This issue does not happen in CentOS, which means it might be an issue with update-rc.d scripts in Ubuntu.

            [CONFSERVER-56186] Confluence doesn't get installed as a service even when the installer is run as root in Ubuntu

            Quan Pham added a comment -

            A fix for this issue is available to Server and Data Center customers in Confluence 6.10.3
            Upgrade now or check out the Release Notes to see what other issues are resolved.

            If you're running the Confluence 6.6 Enterprise release, a fix for this issue is now available in Confluence 6.6.14, which you can find in the Download Archives.

            If you're running the Confluence 6.13 Enterprise release, a fix for this issue is now available in Confluence 6.13.5, which you can find in the Download Archives.

            Quan Pham added a comment - A fix for this issue is available to Server and Data Center customers in Confluence 6.10.3 Upgrade now or check out the Release Notes to see what other issues are resolved. If you're running the Confluence 6.6 Enterprise release, a fix for this issue is now available in Confluence 6.6.14, which you can find in the Download Archives . If you're running the Confluence 6.13 Enterprise release, a fix for this issue is now available in Confluence 6.13.5, which you can find in the Download Archives .

            Minh Tran added a comment -

            A fix for this issue is available to Server and Data Center customers in Confluence 6.12.0
            Upgrade now or check out the Release Notes to see what other issues are resolved.

            Minh Tran added a comment - A fix for this issue is available to Server and Data Center customers in Confluence 6.12.0 Upgrade now or check out the Release Notes to see what other issues are resolved.

            I can confirm that the LSB header is present on a new install of Confluence 6.11.2.

            tc-mossridge added a comment - I can confirm that the LSB header is present on a new install of Confluence 6.11.2.

            Minh Tran added a comment -

            Hi tcassidy1, Have you tried to install Confluence 6.11.2 from scratch and share with me that you are able to see the header?

            Minh Tran added a comment - Hi tcassidy1 , Have you tried to install Confluence 6.11.2 from scratch and share with me that you are able to see the header?

            I just upgraded to Confluence 6.11.2 and did not see any LSB headers in the initscript.

            The following lines (or similar) are what I expected to see in /etc/init.d/confluence.  The status function is copied from the Bitbucket Server initscript.

            #!/bin/bash
            
            ### BEGIN INIT INFO
            # Provides:          confluence
            # Required-Start:    $network $local_fs $syslog
            # Required-Stop:     $network $local_fs $syslog
            # Default-Start:     2 3 4 5
            # Default-Stop:      0 1 6
            # Short-Description: Start Confluence daemon at boot time
            # Description:       Start Confluence daemon at boot time
            ### END INIT INFO
            
            PIDFILE=/opt/atlassian/confluence/work/catalina.pid
            
            start() {
                /opt/atlassian/confluence/bin/start-confluence.sh
            }
            
            stop() {
                /opt/atlassian/confluence/bin/stop-confluence.sh
            }
            
            status() {
                if [ -f $PIDFILE ]; then
                    PID=$(<$PIDFILE)
                    if $(kill -0 "${PID:-}" 2> /dev/null); then
                        echo "Confluence is running"
                        exit 0
                    elif ps "${PID:-}" > /dev/null 2>&1; then
                        echo "Confluence is running"
                        exit 0
                    else
                        echo "Confluence is not running (pidfile exists)"
                        exit 1
                    fi
                fi
            
                echo "Confluence is not running"
                exit 3
            }
            
            # Confluence Linux service controller script
            case "$1" in
                start)
                    start
                    ;;
                stop)
                    stop
                    ;;
                status)
                    status
                    ;;
                restart)
                    stop
                    start
                    ;;
                *)
                    echo "Usage: $0 {start|stop|status|restart}"
                    exit 1
                    ;;
            esac
            

             

            tc-mossridge added a comment - I just upgraded to Confluence 6.11.2 and did not see any LSB headers in the initscript. The following lines (or similar) are what I expected to see in /etc/init.d/confluence.  The status function is copied from the Bitbucket Server initscript. #!/bin/bash ### BEGIN INIT INFO # Provides: confluence # Required-Start: $network $local_fs $syslog # Required-Stop: $network $local_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start Confluence daemon at boot time # Description: Start Confluence daemon at boot time ### END INIT INFO PIDFILE=/opt/atlassian/confluence/work/catalina.pid start() { /opt/atlassian/confluence/bin/start-confluence.sh } stop() { /opt/atlassian/confluence/bin/stop-confluence.sh } status() { if [ -f $PIDFILE ]; then PID=$(< $PIDFILE ) if $(kill -0 "${PID:-}" 2> /dev/null); then echo "Confluence is running" exit 0 elif ps "${PID:-}" > /dev/null 2>&1; then echo "Confluence is running" exit 0 else echo "Confluence is not running (pidfile exists)" exit 1 fi fi echo "Confluence is not running" exit 3 } # Confluence Linux service controller script case " $1 " in start) start ;; stop) stop ;; status) status ;; restart) stop start ;; *) echo "Usage: $0 {start|stop|status|restart}" exit 1 ;; esac  

            Minh Tran added a comment -

            A fix for this issue is available to Server and Data Center customers in Confluence 6.11.2
            Upgrade now or check out the Release Notes to see what other issues are resolved.

            Minh Tran added a comment - A fix for this issue is available to Server and Data Center customers in Confluence 6.11.2 Upgrade now or check out the Release Notes to see what other issues are resolved.

              mtran@atlassian.com Minh Tran
              haftab Hassan Aftab
              Affected customers:
              0 This affects my team
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: