Posts Tagged ‘ linux ’

WSO2 auto initialize as daemon linux

How to make WSO2 solutions work as a daemon on linux and make them auto start on the initlization.

the script [WSO2_HOME]/bin/wso2server.sh is already prepared to start the solution as a Daemon, you just have to call it by informing the parameter start or stop.

[WSO2_HOME]/bin/wso2server.sh start

To make it initialize with you OS you must do as follows:

* First you must change [WSO2_HOME]/bin/wso2server.sh, uncomment and set CARBON_HOME, optionally you can set JAVA_HOME, JAVA_OPTS and also PATH like the following example:

JAVA_OPTS=””PATH=”/sbin:/bin:/usr/sbin:/usr/bin”
CARBON_HOME=”/opt/[WSO2_HOME]”
JAVA_HOME=”/opt/jdk1.6.0_27″

* add the INIT INFO header so the script can be added to the /etc/rc#.d/ folders, like the following example.

#!/bin/sh
### BEGIN INIT INFO
# Provides:          wso2esb
# Required-Start:    $local_fs $remote_fs $network $time
# Required-Stop:    $local_fs $remote_fs $network $time
# Default-Start:     2 3 4 5
# Default-Stop:      0 6
# Short-Description: start WSO2 Enterprise Service Bus
### END INIT INFO

* copy the script to /etc/init.d/ removing the extension .sh,(exemplo: wso2esb);

cp [WSO2_HOME]/bin/wso2server.sh /etc.init.d/wso2esb

* then execute

For ubuntu: sudo update-rc.df wso2esb defaults

For centos: sudo chkconfig –add wso2esb
sudo chkconfig wso2esb on

*This solution applies to WSO2 ESB (Enterprise Service Bus), GREG (Governance Registry), IS (Identity Server), AS(Application Server), ELB (Elastic Load Balancer) and probably all solutions made using WSO2 Carbon.

Memória: Montagem de partição VFAT

Linha de montagem de partição VFAT (Windows) no Ubuntu 9.04.

Alterar arquivo “/etc/fstab” e adicionar a seguinte linha:
/dev/hdb1 /media/hdb1 vfat rw,noexec,nosuid,nodev,uid=1000,gid=1000,umask=0,u tf8=true 0 0

Configurar Eclipse Colorer – take5 no Linux

A dica a seguir me tomou muito tempo, havia até desistido. Hoje  numa ultima tentativa, consegui faze-lo funcionar:

A algum tempo atrás quando comecei a usar o eclipse para editar arquivos ASP/VBSCRIPT (não é a melhor opção, mas uma das melhores existentes no Linux), um colega, Paulo de Tarso, me apresentou o plugin Eclipse Colorer (http://colorer.sourceforge.net/eclipsecolorer/), que simplesmente colore o código asp, porém, depois de ter o computador formatado, nunca mais consegui configura-lo novamente.

A seguir os passos que fiz para instala-lo:

faça o download do pacote, e descompacte na pasta plugins do seu Eclipse:
(EclipseColorer-take5_0.8.0) http://sourceforge.net/project/showfiles.php?group_id=34855&package_id=75558

Até ai tudo bem, porém o EclipseColorer usa de uma lib própria e caso essa não tenha todas suas dependências instaladas irá ocorrer o seguinte erro:

“Error in initialization of a native part of the Colorer library. This can be caused by absent net_sf_colorer.dll (libnet_sf_colorer.so) library in paths of java machine. Or, colorer can’t find catalog.xml file, wich must be placed in ‘%PLUGIN_DIR%/colorer/catalog.xml’ Could not initilize class net.sf.colorer.ParserFactory”

como dito no erro, copie a lib que esta em …/net.sf.colorer_0.8.0/os/linux/x86 para um path que esteja visivel para o java, eu copiei para o /usr/lib mesmo
# cp libnet_sf_colorer.so /usr/lib

após isso use o comando ldd para listar as dependencias:

$ ldd /usr/lib/libnet_sf_colorer.so
linux-gate.so.1 =>  (0xb7f7e000)
libstdc++.so.5 => not found
libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7eb9000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7d69000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7d5e000)
/lib/ld-linux.so.2 (0xb7f7f000)

No meu caso a lib libstdc++.so.5 não existia, simplesmente dei um apt-get na libstdc++5

# apt-get install libstdc++5

Now it works ;]!! para mais informações vejam os fontes a seguir:

Fontes:
http://quattor.begrid.be/trac/centralised-begrid-v5/wiki/Configure_Eclipse
http://lists.debian.org/debian-user-portuguese/2003/12/msg00836.html

Flash – Problema de som no Ubuntu 8.04

Existe um problema no Ubuntu 8.04

A melhor solução que encontrei foi instalar o libflashsupport.

Acredito ser definitiva:

$ sudo apt-get install libflashsupport

Fechar Notebook e mante-lo funcionando normalmente no linux

Linux: Ubuntu 8.04

Hoje quis deixar meu notebook ligado fazendo alguns downloads e com a tampa fechada. Encontrei em algum forum do ubuntu a seguinte solução:

alterar a linha action no arquivo /etc/acpi/events/lidbtn: action=/etc/acpi/screenblank.sh

Assim o notebook apenas desliga a tela quando fechado.
Edit:
A principio parece que essa solução não funciona mais no Ubuntu Karmic Koala 9.10, porém tem um menu para isso:
Sistema>Preferencias > Gerenciamento de Energia ( talvez já existisse nos ubuntus anteriores, nunca observei )