HOAB

History of a bug

Upgrade debian et lost network

Rédigé par gorki Aucun commentaire

Problem :

I manage a dedicated server in OVH and I upgrade my debian from jessie to buster. Upgrade works quite well (it seems...) and I try to restart.

Server reboot fails as unreachable, fortunately OVH rescue mode allows me to login.

I check error log and first lost myself in RAID error message, but it was more simple than that.

Solution :

I check the /etc/network/interfaces file, it was OK

I check the logs files, clean, reboot, check again, still OK except that network was unreachable for named.

I finally remember that Debian switch to systemD in latest version so I tried to create system networking file manually : too complicate, it was not working.

In rescue mode, you can access your files as a mounted point so usual commands as systemctl does not work.

The solution was to chroot a shell :

  1. mkdir /mnt/md2
  2. mount /dev/md2 /mnt/md2
  3. chroot /mnt/md2 bash
  4. systemctl enable networking

And it works...

Now I have to check all other system to be sure that everything is working...

Begining with :

sudo apt-get update

sudo apt-get clean

sudo apt-get autoremove

sudo apt-get update && sudo apt-get upgrade

sudo dpkg --configure -a

 

Oracle 12c et Debian

Rédigé par gorki Aucun commentaire

Le problème :

Après mon article "C'est galère d'installer Oracle XE sur windows 7 64 bits. Parfois ça marche, parfois ça marche pas." Je me suis décidé à utiliser une autre distribution non supportée pour installer Oracle.

Si, si...

Bon après CentOS c'est bien aussi (y'a pas fail2ban par défaut mais c'est bien quand même.).

Pour des bases de développement évidemment. Je ne veux pas voir ça ailleurs..

Solution :

On utilise Oracle EE disponible sur le site d'Oracle

  1. Creation user oracle
  2. Mot de passe oracle
  3. Mettre à jour le .bashrc comme on veut
  4. xhost + en root pour utiliser l'installateur graphique avec l'utilisateur oracle
  5. Les binaires se téléchargent ici : https://wiki.debian.org/DataBase/Oracle
    1. Attention, pas la distribution zlinux évidemment
  6. Les prérequis des librairies (et un certains nombres de tâches décrites ci-dessus) :
    1. https://github.com/antonioluna/oracle12c-debian/blob/master/Pre-install.sh
    2. c'est trop bien...
  7. Dans le .bashrc :
export ORACLE_HOME
export ORACLE_SID
  1. Installation de rlwrap si lors du lancement de sqlplus ca merde
apt-get install rlwrap
  1. Dans mon user oracle
cd ~/oracle-product/product/12.1.0/dbhome_1/dbs$
mv init.ora /home/oracle/oracle-product/product/12.1.0/dbhome_1/dbs/init<MABASE>.or
  1. Creation du repertoire de la base
mkdir /home/oracle/oradata/<MA BASE>
  1. create database
    1. https://docs.oracle.com/cd/B28359_01/server.111/b28310/create003.htm#ADMIN1107
  2. Editer le fichier /home/oracle/oracle-product/product/12.1.0/dbhome_1/dbs/init<MABASE>.ora

# Change '<ORACLE_BASE>' to point to the oracle base (the one you specify at
# install time)

db_name='MABASE'
memory_target=512M
processes = 150
audit_file_dest='/home/oracle/oracle-product/admin/orcl/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='/home/oracle/oracle-product/fast_recovery_area'
db_recovery_file_dest_size=2G
diagnostic_dest='/home/oracle/oracle-product'
dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
# You may want to ensure that control files are created on separate physical
# devices
control_files = (/home/oracle/oradata/mabase/ora_control1, /home/oracle/oradata/mabase/ora_control2)
compatible ='11.2.0'
  1. Recommencer si cela n'a pas fonctionné :

rm -rf /home/oracle/oradata/mabase/*

  1. Creation du user : sqlplus / as sysdba
STARTUP NOMOUNT;

CREATE DATABASE mybase
   USER SYS IDENTIFIED BY lozenge
   USER SYSTEM IDENTIFIED BY lozenge
   LOGFILE GROUP 1 ('/home/oracle/oradata/mybase/redo01.log') SIZE 100M,
           GROUP 2 ('/home/oracle/oradata/mybase/redo02.log') SIZE 100M,
           GROUP 3 ('/home/oracle/oradata/mybase/redo03.log') SIZE 100M
   MAXLOGFILES 5
   MAXLOGMEMBERS 5
   MAXLOGHISTORY 1
   MAXDATAFILES 100
   CHARACTER SET WE8MSWIN1252
   NATIONAL CHARACTER SET AL16UTF16
   EXTENT MANAGEMENT LOCAL
   DATAFILE '/home/oracle/oradata/mybase/system01.dbf' SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
   SYSAUX DATAFILE '/home/oracle/oradata/mybase/sysaux01.dbf' SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
   DEFAULT TABLESPACE calv14
      DATAFILE '/home/oracle/oradata/mybase/database.dbf'
      SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
   DEFAULT TEMPORARY TABLESPACE tempts1
      TEMPFILE '/home/oracle/oradata/mybase/temp01.dbf'
      SIZE 350M REUSE
   UNDO TABLESPACE undotbs1
      DATAFILE '/home/oracle/oradata/mybase/undotbs01.dbf'
      SIZE 350M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;

@${ORACLE_HOME}/rdbms/admin/catalog (long)
@${ORACLE_HOME}/rdbms/admin/catproc <-- dba_data_files est créé ici (encore plus long)
  1. Recommencer si cela n'a pas fonctionné :
    1.  drop user userBase cascade;
  2. Creation du user :
define SG_SCHEMA = 'userBase'
define DEFAULT_TBS = 'mytbs'
define TEMP_TBS = 'tempts1'

CREATE USER &SG_SCHEMA IDENTIFIED BY password
       DEFAULT   TABLESPACE &DEFAULT_TBS
       TEMPORARY TABLESPACE &TEMP_TBS
;
grant connect to &SG_SCHEMA;      
grant resource to &SG_SCHEMA;
GRANT UNLIMITED TABLESPACE TO &SG_SCHEMA;
GRANT CREATE SYNONYM TO &SG_SCHEMA ;
GRANT CREATE VIEW TO &SG_SCHEMA ;

 

SSH au travers de SQUID : connection refused !

Rédigé par gorki Aucun commentaire

Le problème :

Pour gérer plusieurs profils réseaux, j'utilise squid avec une configuration par profil. (Le NetworkManager de debian appelle un script lorsqu'une interface devient disponible, ce script met à jour la configuration squid et le redémarre).

Je voulais donc naturellement faire passer mes connexions SSH au travers de ce proxy.

Après configuration du .ss/config ainsi :

Host *
    ServerAliveInterval 240
    ProxyCommand corkscrew localhost 3128 %h %p
    Compression yes

J'obtenais l'erreur : Couldn't establish connection to proxy: Connection refused

J'ai testé les commandes :

corkscrew  localhost 3128 <mon serveur> 22

Après avoir compris que corkscrew utilise nc :

nc -vv localhost 3128

Toujours le même refus.

Solution : quel client ?

En réalité après avoir trouvé que corkscrew utilise nc les réponses sont plus nombreuses sur le net : aide

Le problème vient du fait que j'utilise Debian qui doit avoir une configuration particulière et Squid écoute exclusivement sur IPV6 :

netstat -tulnap | grep 3128

avec tcp6 dans la ligne :

tcp6       0      0 ::1:3128                :::*                    LISTEN      - 

Donc astuce squid3, modifier la configuration pour écouter sur une adresse IPV4, dans /etc/squid/squid3.conf :

http_port 0.0.0.0:3128

Ca devrait être corrigé bienôt : https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=584

Fil RSS des articles de ce mot clé