I have a Gradle app that I startup using ./gradlew run. This works fine, but I'm trying to deploy to an AWS instance (Ubuntu 12) and I would like the script to execute on boot. I tried writing a startup.sh file with the above command, but no dice. I've also tried adding the command to the /etc/rc.local file, but that doesn't seem to work either. Can someone give me an idea as to how to execute `./gradlew run' on startup? Thanks!
How to write Gradle startup script
4.5k Views Asked by Michael D Johnson At
1
There are 1 best solutions below
Related Questions in GRADLE
- Gradle. Detect dependencies problems
- Gradle Duplicate Entry
- Creating distribution with repackaged spring boot jar using gradle application plugin
- LinkageError after upgrading dropwizard to 0.8.1
- Android Studio unable to run the project
- Add JVM args to spring boot application
- How do I know what is available in minSdkVersion in Android Studio?
- Gradle: Override transitive dependency by version classifier
- gradle get System environment variables
- Why does Eclipse want to download a previous version of Gradle when I already have a later version installed?
- Gradle project sync failed - Gradle DSL method not found: android()
- Use thymeleaf template for some pages and rest for some for building gradle project
- 'Provided' dependency in Gradle
- Invalid Gradle JDK configuration found
- Does Android Studio use Gradle Daemon?
Related Questions in STARTUP
- get all startup processes in windows
- RPi running script at boot then stops
- Java move application to startup folder
- Detect Matlab startup from toolbox
- How to start with liferay
- bento start command fails with NoClassDefFoundError DNSCheckingTool
- Entity Framework Code First 30+ seconds StartUp Time
- How to load database at App Start up?
- Android CalendarView with no default date needed
- Insert data in collection at Meteor's startup
- BBB [debian] How to execute LSBInitscript AFTER loading device tree overlay?
- Error On MongoDB Start Up
- chkconfig not adding redis init script
- Change Stack Location for Cortex M3 in Startup.s file
- Running code without ssh in beaglebone black
Related Questions in UPSTART
- upstart starts python script but it behaves unexpectedly
- ntopng and mysql dependency
- Setting environment variable by fetch the value from an URL before unix services start
- can't query upstart service status from cron job
- Node: 100s of simultaneous requests slows down server substantially. O.S issue?
- upstart script to start a task after hardware clock has been started
- How can I get my Stardog service to autostart in azure ubuntu VM?
- Sudo Access to Rails gem installed from Github
- uwsgi upstart on amazon linux
- I got error 500 from gunicorn whet i set Debug=False in django settings py - Upstart variant
- Forever Node JS startup or stop/starting
- issue with upstart job for statsd
- Upstart If Statements Executing Illogically
- Node.js upstart vs forever
- Running bash script in upstart .conf script
Related Questions in GRADLEW
- Travis-ci command "./gradlew build" exited with 1
- gradle command line, no details on build failure
- How to set proxy url with gradle
- libgdx's gradlew doesn't work in Fedora
- are there gradlew or gradle caches on linux?
- Copy the file from default workdir to target location is not working
- Jenkins: From Gradle 2.2.2.pom com.android.tools.build:gradle:2.2.2
- Can not get gradle wrapper download the gradle distribution from local server
- gradlew is not found (No such file or directory)
- Gradle start new process / kill parent session
- How to run ./gradlew test
- Gradle wrapper version in sub-module is different than in project root
- Jenkins `Make gradlew executable` option do not make `gradelw executable
- Installing hibernate artifacts from source
- Disable test cache when running through gradle
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I wrote the following init script for starting gradle applications at system startup for redhat distros (centos/fedora etc).
You need to perform a few steps to tie it all together:
gradle distZiponto your target serverAn example configuration file
/etc/my-service.confNote the path to the application from the distZip in the prog line.
You then link the init script to the actual service you want it to be run as, e.g.
Once you've done this, you can use chkconfig to add the service in the usual way (it defaults to 3/4/5)
Here is the script
gradle-init-start-stop