-
Bug
-
Resolution: Answered
-
Medium
-
None
-
None
-
None
-
1
-
Severity 3 - Minor
-
15
-
There is currently a problem with stopping Bitbucket server instance in data center:
While starting a bitbucket server instance with "start-bitbucket.sh" in DataCenter supports "--no-search" option to not start a local elastic-search instance, the "stop-bitbucket.sh" does not support such an option.
As a result the script does successfully stops the bitbucket instance, but then tries to stop the not-existent elasticsearch instance resulting in an errorcode.
As a consequence, using the script in initd/systemd the "systemctl stop bitbucket" will "fail" and the service is marked as "failed", even if was successfully stopped. This is a very annoying situation.
Example of /etc/systemd/system/bitbucket.service:
[Unit] Description=Bitbucket After=syslog.target network.target[Service] Type=forking User=bitbucket Environment=JAVA_HOME=/usr/java/default PIDFile=/var/opt/atlassian/bitbucket/log/bitbucket.pid ExecStart=/opt/atlassian/bitbucket/bitbucket_current/bin/start-bitbucket.sh --no-search ExecStop=/opt/atlassian/bitbucket/bitbucket_current/bin/stop-bitbucket.sh [Install] WantedBy=multi-user.target
As in "start-bitbucket.sh" the "--no-search" should be implemented in stop-Bitbucket and - if set - skip the part to stop the (non-exsitent) local elasticsearch instance.