I have used the Maven appassembler plugin to generate Linux wrapper scripts around a Java Spring application 'myapp'.
I then get the following directory structure:
/home/myapp/platform/bin/myapp <== Script that I start manually
The myapp script has "-rwxr-xr-x" rights and the owner is set to "myapp:myapp" and the script is set to run as user "myapp" (set from the Maven settings when building).
Now from root I issued the following command:
$ sudo ln -s /home/myapp/platform/bin/myapp /etc/init.d/service_myapp
which creates a symbolic link with "lrwxrwxrwx" rights and "root:root" as owner and points to my myapp script. I thought that would be enough to have this script execute at startup. However it doesn't seem to run. If I run it manually like:
$ cd /etc/init.d/
$ ./service_myapp
then I'm prompted for a password before it executes.
Can anyone explain what is happening here and/or what I'm doing wrong?
I have also tried this:
$ cd /etc/init.d/
$ update-rc.d service_myapp defaults 20
but gets this:
update-rc.d: warning: /etc/init.d/service_myapp missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
Adding system startup for /etc/init.d/service_myapp ...
/etc/rc0.d/K20service_myapp -> ../init.d/service_myapp
update-rc.d: symlink: Permission denied