You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Joe Luo (JIRA)" <ji...@apache.org> on 2010/11/10 18:35:18 UTC
[jira] Updated: (KARAF-270) karaf-service scripts tries to create
"data" directory in wrong location
[ https://issues.apache.org/jira/browse/KARAF-270?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Joe Luo updated KARAF-270:
--------------------------
Attachment: karaf-service.patch
> 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
> Attachments: karaf-service.patch
>
>
> To start FUSE ESB as a service, we need to install wrapper feature first:
> {code}
> $features:install wrapper
> $wrapper:install
> {code}
> karaf-service and karaf-wrapper will be generated in "\bin" directory. Then we need to link karaf-service to /etc/init.d/. When we start the service through either "service karaf-service start" or "/etc/init.d/karaf-sevice start" command, the karaf-service scripts tries to create "data" directory in wrong location:
> {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-fuse-01-00 install dir>/bin" directory.
> If we install FUSE ESB into /opt directory, say we have directory structure like:
> /opt/apache-servicemix-4.2.0-fuse-01-00
> "/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-fuse-01-00". It will be fine if the service is started by root user. However, it will fail with below error 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 generated karaf-service scripts to "../data"
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.