Wednesday, November 23, 2016

Oracle 12c Pre install script... almost perfect !



When installing Oracle 12c, on a Oracle Linux server, you can perform most of the prerequisites settings by using a cool script:

yum install oracle-rdbms-server-12cR1-preinstall


Problem is that the script fails when started (really, was out of the box / freshly installed from Oracle repos):
oracle-rdbms-server-12cR1-preinstall-verify
/bin/sed: -e expression #1, char 116: unknown command: `3'
/bin/sed: -e expression #1, char 116: unknown command: `3'

Error above can be rectified with the following change ( use ' instead of  " on line 570 )

cp /usr/bin/oracle-rdbms-server-12cR1-preinstall-verify /usr/bin/oracle-rdbms-server-12cR1-preinstall-verify.bak

vi /usr/bin/oracle-rdbms-server-12cR1-preinstall-verify

diff /usr/bin/oracle-rdbms-server-12cR1-preinstall-verify /usr/bin/oracle-rdbms-server-12cR1-preinstall-verify.bak
<             ${SED} -i /'^#[[:space:]]*$COMMENT'/d ${LIMITSFILE}
---
>             ${SED} -i /"^#[[:space:]]*$COMMENT"/d ${LIMITSFILE}
570c570
<           ${SED} -i /'^#[[:space:]]*$COMMENT'/d ${LIMITSFILE}
---
>           ${SED} -i /"^#[[:space:]]*$COMMENT"/d ${LIMITSFILE}


Then you can use the script that saves you time for settings a lot of parameters needed for prerequisites.


Red Hat RHEL7 - NFS service is down - reboot needed




Problem:
NFS service is down

Logs: 
[16-11-23-10:06:00] [root@servername - ~]
cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.3 (Maipo)


[16-11-23-10:06:02] [root@servername - ~]
systemctl status nfs-server.service
● nfs-server.service - NFS server and services
   Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2016-11-23 10:06:02 CET; 7s ago
  Process: 11699 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=1/FAILURE)
  Process: 11697 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
 Main PID: 11699 (code=exited, status=1/FAILURE)

Nov 23 10:06:02 servernamesystemd[1]: Starting NFS server and services...
Nov 23 10:06:02 sservername rpc.nfsd[11699]: rpc.nfsd: writing fd to kernel failed: errno 111 (Connection refused)
Nov 23 10:06:02 servername rpc.nfsd[11699]: rpc.nfsd: unable to set any sockets for nfsd
Nov 23 10:06:02 servername systemd[1]: nfs-server.service: main process exited, code=exited, status=1/FAILURE
Nov 23 10:06:02 servername systemd[1]: Failed to start NFS server and services.
Nov 23 10:06:02 servernamesystemd[1]: Unit nfs-server.service entered failed state.
Nov 23 10:06:02 servernamesystemd[1]: nfs-server.service failed.


So checking the rpcbind service:

[16-11-23-10:07:18] [root@servername - ~]
systemctl status rpcbind.service start
● rpcbind.service - RPC bind service
   Loaded: loaded (/usr/lib/systemd/system/rpcbind.service; indirect; vendor preset: enabled)
   Active: failed (Result: start-limit) since Wed 2016-11-23 05:31:58 CET; 4h 35min ago
 Main PID: 1278 (code=exited, status=0/SUCCESS)

Nov 23 05:31:58 servername systemd[1]: Starting RPC bind service...
Nov 23 05:31:58 servername rpcbind[20677]: /sbin/rpcbind: symbol lookup error: /sbin/rpcbind: undefined symbol: libtirpc_set_debug
Nov 23 05:31:58 servername systemd[1]: rpcbind.service: control process exited, code=exited status=127
Nov 23 05:31:58 servername systemd[1]: Failed to start RPC bind service.
Nov 23 05:31:58 servername systemd[1]: Unit rpcbind.service entered failed state.
Nov 23 05:31:58 servername systemd[1]: rpcbind.service failed.
Nov 23 05:31:58 servername systemd[1]: start request repeated too quickly for rpcbind.service
Nov 23 05:31:58 servername systemd[1]: Failed to start RPC bind service.
Nov 23 05:31:58 servername systemd[1]: rpcbind.service failed.



Solution:
actually, a quite big set of update was applied from Red Hat Satellite, and server needed a reboot (even if it was not advertised by Satellite updates summary).
shutdown -r now
As I did not find any related information for the errors above, I quickly write this :)


Friday, February 12, 2016

Visual Studio 2015 - and GNU Make : Path is truncated, while PATH is complete!


Quick view:

Not sure why, but I have 2 path variables: Path and PATH.
PATH is complete and shows no problem.
Path is trimmed after ...Common7\IDE because of the trailing\


Details:
Just a quick note for who may encounter this problem with your bat files when you used to build your program under Visual Studio 2003 2005 2008 or 2010, and start using Visual Studio 2015.

I use a bat script with these 2 lines:
call "%VS140COMNTOOLS%\vsvars32.bat"
make bin

I call GNU make , a windows binary version of it (installed by Unix For Windows: C:\Program Files\unixforwindows\usr\local\wbin\make.exe )

It shows this environment from the Windows command "set" I've put in the Makefile:

Path=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86
)\MSBuild\14.0\bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE(STOPS HERE)

PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86
)\MSBuild\14.0\bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools;C:\Windows\Microsoft.NET\Framework\v4.0.30319;C
:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\VCPackages;etc...


You can see the Path (used by GNU Make) is truncated. PATH (used by other windows tools) is ok.

Problem is this line in :%VS140COMNTOOLS%\vsvars32.bat
@set DevEnvDir=%VSINSTALLDIR%Common7\IDE\


I needed to remove the trailing \ :
@set DevEnvDir=%VSINSTALLDIR%Common7\IDE



Visual Studio 2015 - Win32 release is now wrong / Release changed from Win32 to x86




When this used to work just fine with Microsoft Visual Studio 2003, 2005, 2008 or 2010:
call "%VS90COMNTOOLS%\vsvars32.bat"
devenv xxx.vcxproj /Build "Release|win32"
devenv xxx.vcxproj /Build "Release|x64"

I needed to have this in my script with Microsoft Visual Studio 2015
call "%VS140COMNTOOLS%\vsvars32.bat"
devenv xxx.vcxproj /Build "Release|x86"
devenv xxx.vcxproj /Build "Release|x64"


It's a quick post, if you have question, please post a comment! 

Tuesday, December 16, 2014

Solaris 10: an LDAP user can login, but can't use SSH: You don't exist, go away!


As said in the title, I've encountered
Solaris 10: an LDAP user can login, but can't use SSH: You don't exist, go away!


Symptom: 
[14-12-03 - 14:09:54 on servername]  ~$ id -auid=1201 gid=1200 groups=1200,1300
[14-12-03 - 14:08:13 on servername]  ~$ ssh -vv
You don't exist, go away!

Cause:
users (not in root or sys group) can't access information from LDAP Server

Solution:
as root:

 
[14-12-03 - 14:40:42 on servername] root /etc
$ chmod o+r /var/ldap/*
[14-12-03 - 14:42:05 on servername] root /etc
$ ll /var/ldap/*
-rw-r--r--   1 Template root         10K Dec  3 13:45 /var/ldap/cachemgr.log
-rw----r--   1 Template root         64K Aug  5  2013 /var/ldap/cert8.db
-rw----r--   1 Template root         32K Aug  5  2013 /var/ldap/key3.db
-r-----r--   1 Template root         222 Dec  3 13:38 /var/ldap/ldap_client_cred
-r-----r--   1 Template root         478 Dec  3 13:38 /var/ldap/ldap_client_file
-rw----r--   1 Template root         32K Aug  5  2013 /var/ldap/secmod.db

then "id" commands show correct results coming from LDAP server:
[14-12-03 - 14:14:15 on servername] alex ~
$ id -a
uid=1201(alex) gid=1200(admin) groups=1200(admin),1300(support)


It's a quick post, please leave your questions in the comments! 

Tuesday, April 8, 2014

Quick how to: extend a linux encrypted partition



You have a linux virtual machine with an encrypted hard drive. How to quickly extend it ?


Environment (this method may apply to other environments):
  • Virtualization type: 
    • VMWare ESX
  • Linux:
    • RHEL 5.7
    • using main root partition as an LVM encrypted with LUKS
      / in /dev/sda2
    • using a boot partition /boot in /dev/sda1

Quick method:
  • give more space from VMWare
    •  edit settings / Hardware / Hard Disk / change the value in "provisioned size"
      (it is usually grayed out when you already have a snapshot)
    • create a snapshot (to roll back in case of problem)
  • boot a live CD
    • from VMWare, Edit Settings / CD DVD adapter / load ISO (I used a debian7 cd image) + connected at poweron
    • edit bios setting to boot on cd
    • Boot on virtual CD: for my Debian 7, I booted in ExpertMode / Rescue Disk 
  • From the live cd console
    • extend physical parition
      fdisk /dev/sda
      sequence is: d 2 n p 2 t 2 8e w

      (sequence meaning: delete partition2, new partiiton primary, number2, change type of parititon2 to LVM (8e) )
    • Open CRYPT
      cryptsetup luksOpen /dev/sda2 crypt1
    • extend  CRYPT:
      cryptsetup resize crypt1
    • entend PV:
      pvdisplay /dev/mapper/crypt1
      pvresize /dev/mapper/crypt1
      pvdisplay /dev/mapper/crypt1
    • entend LV:
      lvdisplpay
      lvresize -L +30G /dev/VolGroup00/LogVol00
      lvdisplay
  • reboot your server as usual
    • extend filesystem:
      resize2fs  -p /dev/mapper/VolGroup00-LogVol00
    • check new available size:
      df -h
That's it

Notes:
this is a quick (and dirty) how to.
It does not cover good practice like writing random data in the disk space we merge with our LUKS partition. It uses a live cd to avoid lock and root unmount problems.
I hope it will be useful for some readers ! Comments welcome