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:33:16 UTC

[jira] Created: (KARAF-270) karaf-service scripts tries to create "data" directory in wrong location

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


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.


[jira] Resolved: (KARAF-270) karaf-service scripts tries to create "data" directory in wrong location

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
     [ 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.


[jira] Updated: (KARAF-270) karaf-service scripts tries to create "data" directory in wrong location

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-270?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet updated KARAF-270:
----------------------------------

    Fix Version/s: 2.1.2

> 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.1.2, 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.


[jira] Updated: (KARAF-270) karaf-service scripts tries to create "data" directory in wrong location

Posted by "Joe Luo (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-270?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Luo updated KARAF-270:
--------------------------

    Description: 
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".

  was:
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"


> 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
>
>
> 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.


[jira] [Closed] (KARAF-270) karaf-service scripts tries to create "data" directory in wrong location

Posted by "Jamie goodyear (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-270?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jamie goodyear closed KARAF-270.
--------------------------------

    
> 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.1.2, 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (KARAF-270) karaf-service scripts tries to create "data" directory in wrong location

Posted by "Joe Luo (JIRA)" <ji...@apache.org>.
     [ 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.


[jira] Assigned: (KARAF-270) karaf-service scripts tries to create "data" directory in wrong location

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KARAF-270?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet reassigned KARAF-270:
-------------------------------------

    Assignee: Guillaume Nodet

> 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
>         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.