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!
相关问题
- Could not read entry … from cache taskArtifacts.bi
- Configure gradle plugin based on future tasks
- How to fix the error Cannot change strategy of con
- Include pom.xml in Jar with gradle
- Gradle vs Compiler
相关文章
- Android BuildConfig Field generating String incorr
- Gradle Could not find method “() for arguments on
- Gradle Custom Plugin: gradleApi() vs Explicit Depe
- Android Studio 3.5 ERROR: Unable to resolve depend
- How to specify @category in test task in gradle?
- How to clean your build with Flutter RP2 in Androi
- Remove transitive classpath dependency in gradle
- Execution failed for task ':bintrayUpload'
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 distZip
onto your target serverAn example configuration file
/etc/my-service.conf
Note 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