Tag Archive for gentoo

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

Jenkins install from binary on Gentooo

Edit /etc/layman/layman.cfg and add new overlay list :

overlays  : http://www.gentoo.org/proj/en/overlays/layman-global.txt
            http://godin-gentoo-repository.googlecode.com/svn/trunk/layman.xml

Or in one line:

layman -f -o http://godin-gentoo-repository.googlecode.com/svn/trunk/layman.xml -a godin

Add to sync list :

layman -S
layman -L
layman -a godin

Add to make.conf :

echo "dev-util/jenkins-bin" >> /etc/portage/package.keywords

emerge the ebuild:

emerge -av dev-util/jenkins-bin