It's not the same without you
Join the community to find out what other Atlassian users are discussing, debating and creating.
I Want a script to statup stash on linux ubuntu/debian.
This is a self question. I know a possible answer, but I can't comment on the Stash Documentation (I think is disabled). I made this question to share my script and get feedback from others.
Create a startup script on /etc/init.d/stash with the contents:
#!/bin/bash # RUN_AS: The user to run fisheye as. Its recommended that you create a separate user account for security reasons RUN_AS=stash # STASH_INSTALLATION: The path to the Stash installation. Its recommended to create a symbolic link to the latest version so # the process will still work after upgrades. STASH_INSTALLATION="/opt/atlassian/stash" STASH_HOME="/var/atlassian/application-data/stash" stashctl() { if [ "x$USER" != "x$RUN_AS" ]; then su - "$RUN_AS" -c "export STASH_HOME=$STASH_HOME;$STASH_INSTALLATION/bin/$1" else "export STASH_HOME=$STASH_HOME;$STASH_INSTALLATION/bin/$1" fi } case "$1" in start) stashctl start-stash.sh ;; stop) stashctl stop-stash.sh ;; restart) stashctl stop-stash.sh sleep 10 stashctl start-stash.sh ;; *) echo "Usage: $0 {start|stop|restart}" esac exit 0
This script is based on a Fisheye startup script. I recommend create a stash user, set the permissions to that user, and create a symlink to easy upgrades:
adduser stash cd /opt/atlassian ln -s atlassian-stash-1.0.0 stash chown stash.stash -R /opt/atlassian/stash chown stash.stash /var/atlassian/application-data/stash/
To startup on the system boot:
update-rc.d stash defaults
Other alternative is to use something like daemontools. The benefit of this over the init script above is it will monitor the process and ensure it restarts if errors occur. Plus you can set it up to have much nicer environment variable handling etc..
It is more involved initially creating correct run scripts etc.. but I find superior to the init scripts
Documentation is here:
https://confluence.atlassian.com/display/STASH/Running+Stash+as+a+Linux+service
Thx Melanie :)
And juste because I stumbled on that myself, when installing any atlassian product as a service on Debian flavored linuxes (Debian, Ubuntu), one can use the above script (I use it for Jira and Stash). It's not fully LSB compliant, but it works well.
One has to remember if said product uses a SSL connector (via catalina) to also copy the .keystore (after importing SSL certificate) to the "dedicated user account's homedir" (created for this script's usage) too.
Not stash specific, but as you opened a 'linux services' issue, might as well point that out.
Have a nice day
EDIT1 : cf this Running+JIRA+over+SSL+or+HTTPS
EDIT2 : following previous link, for the 'service user'
1 ) either generate the SSL cert and import it (.keystore) while logged under the service user's account, then in 'server.xml' specify its location with
<Connector port="443" maxHttpHeaderSize="8192" (...) SSLEnabled="true" (...) keystorePass="password" keystoreFile="/home/serviceuser/.keystore" />
Points "SSLEnabled", "KeystorePass", and "keystoreFile" are not documented in the referenced article's body, but are all compulsory. Omitting 'keystoreFile' won't result in any error in the 'catalina.log' file, the '.keystore' is found, but... it won't be loaded properly by tomcat.
I just released my deb-package to outside. It maybe usefull for installing Stash on Ubuntu:
https://bitbucket.org/lelik/atlassian-stash-deb
Feel free to test and post issues to tracker.
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.
Read moreBitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda ...
Connect with like-minded Atlassian users at free events near you!
Find a groupConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.
Start an AUGYou're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.