Tag Archive for gentoo

Gentoo USB serial passthrough KVM

I have a Conbee II Zigbee receiver. After a restart the USB passthrought stopped working (on the guest VM I always get errors like:

usb 2-2: new low-speed USB device number 25 using uhci_hcd
usb 2-2: Invalid ep0 maxpacket: 64 usb
usb2-port2: unable to enumerate USB device

So I decided, passthrough the USB serial. It’s a little tricky 🙂

    <serial type='dev'>
      <source path='/dev/ttyACM0'/>
      <target type='isa-serial' port='1'>
        <model name='isa-serial'/>
      </target>
    </serial>

The trick is the serial type because it is dev.

src: http://baitisj.blogspot.com/2021/02/serial-device-passthrough-from-linux.html

Hassio with supervisor on Gentoo by docker

Supervisor, first start

Docker pull:

docker pull homeassistant/qemux86-64-homeassistant:landingpage

Than, start it:

docker run -d --name hassio_supervisor \
--privileged \
--security-opt apparmor:unconfined \
--security-opt seccomp=unconfined \
-v /run/docker.sock:/run/docker.sock \
-v /run/dbus:/run/dbus \
-v "/opt/hassio/data":/data \
-e SUPERVISOR_SHARE="/opt/hassio/data" \
-e SUPERVISOR_NAME=hassio_supervisor \
-e HOMEASSISTANT_REPOSITORY="homeassistant/qemux86-64-homeassistant" \
homeassistant/amd64-hassio-supervisor:224

gentoo beragadt init script takarĂ­tĂĄsa

/etc/init.d/docker zap

 

gigabit e1000e Detected Hardware Unit Hang

If we see it in

$ dmesg
[Tue Feb 13 20:53:07 2018] e1000e 0000:00:19.0 eno1: Detected Hardware Unit Hang:
                             TDH                  <1b>
                             TDT                  <76>
                             next_to_use          <76>
                             next_to_clean        <1b>
                           buffer_info[next_to_clean]:
                             time_stamp           <361c0382c>
                             next_to_watch        <1e>
                             jiffies              <361c056ec>
                             next_to_watch.status <0>
                           MAC Status             <80083>
                           PHY Status             <796d>
                           PHY 1000BASE-T Status  <3800>
                           PHY Extended Status    <3000>
                           PCI Status             <10>
[Tue Feb 13 20:53:07 2018] e1000e 0000:00:19.0 eno1: Reset adapter unexpectedly

the resulution is:

$ ethtool -K eth0 gso off gro off tso off

 

for gentoo, add these lines into

$ vi /etc/conf.d/net
postup(){

  /usr/sbin/ethtool -K eno1 gso off gro off tso off

}

 

src: https://serverfault.com/questions/616485/e1000e-reset-adapter-unexpectedly-detected-hardware-unit-hang

apache tomcat multiple instances on gentoo

user $/usr/share/tomcat-7/gentoo/tomcat-instance-manager.bash
No action specified!
Usage: /usr/share/tomcat-7/gentoo/tomcat-instance-manager.bash <--create|--remove|--help> [--suffix s][--user u][--group g]

  Options:
    --help:
      show this text.
    --create:
      create a new instance
    --remove:
      remove an existing instance.
    --suffix SUFFIX:
      a suffix for this instance. the suffix may not collide with an already
      existing instance, defaults to empty.
    --user USER:
      the user for which to configure this instance for. The user needs to
      exist already. defaults to tomcat.
    --group GROUP:
      the group for which to configure this instance for. The group needs to
      exist already. defaults to tomcat.

Examples:

/usr/share/tomcat-7/gentoo/tomcat-instance-manager.bash --create --suffix testing --user tacmot --group tacmot
/usr/share/tomcat-7/gentoo/tomcat-instance-manager.bash --remove --suffix testing

Follow the information in the help to create new Tomcat instances. Tomcat instances use the following layout:

  • /etc/conf.d/tomcat-SLOT-suffix: configuration file for running Tomcat instance services
  • /etc/init.d/tomcat-SLOT-suffix: controlling script for the Tomcat instance
  • /etc/tomcat-SLOT-suffix/: directory containing standard Tomcat configuration files
  • /var/lib/tomcat-SLOT-suffix/: Catalina base directory
  • /var/log/tomcat-SLOT-suffix/: directory for instance log files

Gentoo szerveren Tomcat-ben, alkalmazås specifikus propertie fåjl classpath-ra tétele

ElƑször is megnyitjuk a tomcat conf-ot

vi /etc/conf.d/tomcat-7-main

majd itt a

az alĂĄbbi sort mĂłdosĂ­tjuk pl:

JAVA_OPTS="-Dtimetracker_config_location=file:///var/lib/tomcat-7-main/properties/timetracker.properties

 

 

SSL tanusitvany generalasa

HTTPS protokollhoz sajat, alairt kulcs es tanusitvany generalasa:

openssl genrsa 2048 > ronhks.hu.key
openssl req -new -x509 -nodes -sha1 -key ronhks.hu.key > ronhks.hu.crt

 

Glassfish start script

Hogy is kell, gentoo alatt glassfish szervert indító scriptet csinålni. Álljon alåbb a példa:
LĂ©trehozunk egy file-t /usr/local/bin/gf_start tartalma:

#!/bin/bash
/opt/glassfish/glassfish3/bin/asadmin start-domain

Kell egy stop is: /usr/local/bin/gf_stop tartalma:

#!/bin/bash
/opt/glassfish/glassfish3/bin/asadmin stop-domain

És maga az indító script /etc/init.d/glassfish aminek a tartalma:

#!/sbin/runscript

depend() {
        need net
}

start() {
        ebegin "Starting glassfish"
        # Ensure that we run from a readable working dir, and that we do not
        # lock filesystems when being run from such a location.
        cd /
        start-stop-daemon --start --quiet --background --make-pidfile --pidfile /var/run/glassfish.pid --exec /usr/local/bin/gf_start
        eend $?
}

stop() {
        ebegin "Stopping glassfish"
        /usr/local/bin/gf_stop
        eend $?
}

restart() {
        if ! service_stopped "NULL" ; then
                svc_stop || return "$?"
        fi
        svc_start
}

Gentoo – out of space

egy kis ellenƑrzĂ©s a fĂŒggƑsĂ©gekre:

revdep-rebuild

majd

eclean distfiles

Ă©s/vagy

eclean packages

Ha Gentoo széthullik update-kor

Ha meghal a gentoo Ă©s se einfo, se rc-service

emerge -ave system 
emerge -ave world 
revdep-rebuild