Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSW Daemon: Unable to resolve the full path of the configuration file #52

Open
fgette-delfingen opened this issue Nov 25, 2016 · 2 comments
Labels

Comments

@fgette-delfingen
Copy link

We use appassembler to generate a Java Daemon based on JSW. This daemon runs as a service in an Unix environment.
We use traditional Sysvinit to configure this service.
But when server reboots, the following error occurs:
FATAL | wrapper | Unable to resolve the full path of the configuration file, /etc/conf/wrapper.conf: No such file or directory

I think this problem is caused by the fact we use multiple levels of soft link.

Our shell script (generated by the plugin) is named "myDaemon".
Content of folder /etc/init.d:
myDaemon -> ../../home/myApss/bin/myDaemon
Content of folder /etc/rc2.d: (we start at runlevel 2):
S20myDaemon -> ../init.d/myDaemon

The unix template of the plugin doesn't deal with multiple levels of soft link. See appassembler-maven-plugin/src/main/patches/sh.script.in
As a workaround we use a modified version of this unix template. If you think my analyse is ok, I can create a pull request with our fixed unix template.

@dantran
Copy link
Contributor

dantran commented Nov 25, 2016

@fgette-delfingen
Copy link
Author

Thank you Dantran. We effectively use this configuration with our specific unix template.
For those who might have the same problem, here is the fragment of shell that we use (we added the "while" statement):

...
# discover BASEDIR
BASEDIR=`dirname "$0"`/..
BASEDIR=`(cd "$BASEDIR"; pwd)`
ls -l "$0" | grep -e '->' > /dev/null 2>&1
if [ $? = 0 ]; then
  #this is softlink
  _PWD=`pwd`
  _EXEDIR=`dirname "$0"`
  cd "$_EXEDIR"
  _BASENAME=`basename "$0"`
  _REALFILE=`ls -l "$_BASENAME" | sed 's/.*->\ //g'`
   while [ -h $_REALFILE ]; do
     _REALFILE=`ls -l "$_REALFILE" | sed 's/.*->\ //g'` 
   done
   BASEDIR=`dirname "$_REALFILE"`/..
   BASEDIR=`(cd "$BASEDIR"; pwd)`
   cd "$_PWD"
fi
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants