rc.local

Fórum em português destinado a discussões gerais e ajuda aos usuários do BrazilFW 3.x

rc.local

Mensagempor the_wolf » Seg Abr 09, 2018 8:35 pm

Boa noite.
Estou usando a versão 3.0.262.
Estou estudando python, fiz os addons vim8 e python 3.6.5.

O addon python contêm click, Flask-0.12.2.dist-info, Jinja2-2.10.dist-info, pip-9.0.3.dist-info, setuptools-39.0.1.dist-info, click-6.7.dist-info itsdangerous-0.24.dist-info, markupsafe, pkg_resources, werkzeug, easy_install.py, itsdangerous.py, MarkupSafe-1.0.dist-info, Werkzeug-0.14.1.dist-info, flask, jinja2, pip e setuptools.

Estou usando virtualenv. E esta funcionando tudo 100%.

Agora estou querendo que o sistema que estou desenvolvendo inicialize com o sistema. Fiz um script de start o init.sh. o conteúdo dele:
Código: Selecionar todos
#!/bin/sh
cd /partition/hellopython/
source ./env/bin/active
py run.py


Quando dou start nele, mas aparece a mensagem:
./init.sh: source: line 3: can't open './env/bin/active'


Mas se executo o comando na mão funciona tudo normal.

Desde já agradeço.
Avatar do usuário
the_wolf
BFW Curious
 
Mensagens: 5
Registrado em: Sáb Out 08, 2016 1:08 pm
BrazilFW Box:

Re: rc.local

Mensagempor GEFSANTANA » Ter Abr 10, 2018 10:39 pm

Quanto as permissões de execução, estão devidamente configuradas? Se possível detalhe o arquivo.
Caso tenha resolvido seu problema detalhe a solução do mesmo e clique no botão Resolvido. Pois assim manteremos o fórum organizado.

"Há três métodos para ganhar sabedoria: primeiro, por reflexão, que é o mais nobre; segundo, por imitação, que é o mais fácil; e terceiro, por experiência, que é o mais amargo". - Confúcio.
Avatar do usuário
GEFSANTANA
BFW Team
 
Mensagens: 1132
Registrado em: Qua Out 22, 2008 12:57 pm
Localização: Aracaju - SE - BR
BrazilFW Box: Não Estou com o BFW ativo.

Re: rc.local

Mensagempor the_wolf » Qua Abr 11, 2018 3:02 am

Sim coloquei como executável, adicionei o #!/bin/sh. Tentei executar de varias formas como:
. ./env/bin/active
source ./env/bin/active
source /partition/helopython/env/bin/active
. /partition/hellopython/env/bin/active

E não executou.

O conteúdo do arquivo é esse:

Código: Selecionar todos
# This file must be used with "source bin/activate" *from bash*
# you cannot run it directly

deactivate () {
    # reset old environment variables
    if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
        PATH="${_OLD_VIRTUAL_PATH:-}"
        export PATH
        unset _OLD_VIRTUAL_PATH
    fi
    if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
        PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
        export PYTHONHOME
        unset _OLD_VIRTUAL_PYTHONHOME
    fi

    # This should detect bash and zsh, which have a hash command that must
    # be called to get it to forget past commands.  Without forgetting
    # past commands the $PATH changes we made may not be respected
    if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
        hash -r
    fi

    if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
        PS1="${_OLD_VIRTUAL_PS1:-}"
        export PS1
        unset _OLD_VIRTUAL_PS1
    fi

    unset VIRTUAL_ENV
    if [ ! "$1" = "nondestructive" ] ; then
    # Self destruct!
        unset -f deactivate
    fi
}

# unset irrelevant variables
deactivate nondestructive

VIRTUAL_ENV="/partition/hellopython/env"
export VIRTUAL_ENV

_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH

# unset PYTHONHOME if set
# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
# could use `if (set -u; : $PYTHONHOME) ;` in bash
if [ -n "${PYTHONHOME:-}" ] ; then
    _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
    unset PYTHONHOME
fi

if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
    _OLD_VIRTUAL_PS1="${PS1:-}"
    if [ "x(env) " != x ] ; then
   PS1="(env) ${PS1:-}"
    else
    if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then
        # special case for Aspen magic directories
        # see http://www.zetadev.com/software/aspen/
        PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1"
    else
        PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1"
    fi
    fi
    export PS1
fi

# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands.  Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
    hash -r
fi
Avatar do usuário
the_wolf
BFW Curious
 
Mensagens: 5
Registrado em: Sáb Out 08, 2016 1:08 pm
BrazilFW Box:


Voltar para BrazilFW 3.x - Ajuda em Geral

Quem está online

Usuários navegando neste fórum: Nenhum usuário registrado e 13 visitantes

cron