[ https://issues.apache.org/jira/browse/KARAF-270?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Guillaume Nodet resolved KARAF-270. ----------------------------------- Resolution: Fixed Fix Version/s: 2.2.0 Fixed with a slightly different patch. Committing to https://svn.apache.org/repos/asf/karaf/trunk ... M shell/wrapper/src/main/resources/org/apache/karaf/shell/wrapper/unix/karaf-service Committed r1035430 > karaf-service scripts tries to create "data" directory in wrong location > ------------------------------------------------------------------------- > > Key: KARAF-270 > URL: https://issues.apache.org/jira/browse/KARAF-270 > Project: Karaf > Issue Type: Bug > Affects Versions: 2.1.0 > Environment: Unix > Reporter: Joe Luo > Assignee: Guillaume Nodet > Fix For: 2.2.0 > > Attachments: karaf-service.patch > > > karaf-service scripts tries to create "data" directory in wrong location. > Here is start() function: > {code} > start() { > echo "Starting $APP_LONG_NAME..." > getpid > if [ "X$pid" = "X" ] > then > if [ ! -d ../../data ]; then > mkdir ../../data > fi > if [ ! -d ../../data/log ]; then > mkdir ../../data/log > fi > COMMAND_LINE="$CMDNICE $WRAPPER_CMD $WRAPPER_CONF > wrapper.syslog.ident=$APP_NAME wrapper.pid > file=$PIDFILE wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $LOCKPROP" > exec $COMMAND_LINE > else > echo "$APP_LONG_NAME is already running." > exit 1 > fi > } > {code} > Basically, it tries to create "data" directory two levels up from > "<apache-servicemix-4.2.0 install dir>/bin" directory. > If we install servicemix into /opt directory, say we have directory structure > like: > /opt/apache-servicemix-4.2.0 > "/opt" is owned by root user. So the karaf-scripts tries to create "data" > directory directly under "/opt" which is outside of > "/opt/apache-servicemix-4.2.0". It will be fine if the service is started by > root user. However, it will fail with error below if the service is started > by any other users: > {quote} > Starting karaf... > mkdir: cannot create directory `../../data': Permission denied > mkdir: cannot create directory `../../data/log': No such file or directory > {quote} > To fix this problem, we need to change "../../data" from karaf-service > scripts start() function to "../data". -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.