Archive

Archive for İ

Dealing with PHP Segfault in CentOS 6.5

Bir müddət əvvələ qədər DMESG output-dan aldığımız məlumata əsasən commandline-dan çalışdırılan PHP kod serverde segfult error-lar verir, bir müddətdən sonra isə server-in özünü necə deyərlər “itiririk”:

php[2682]: segfault at ffffffff ip 000000000058b19f sp 00007fff4f51eae0 error 4 in php[400000+2c0000]
php[4478]: segfault at ffffffff ip 000000000058b19f sp 00007fffd5b5b3e0 error 4 in php[400000+2c0000]
php[5883]: segfault at ffffffff ip 000000000058b19f sp 00007fff6e5ddd70 error 4 in php[400000+2c0000]
php[8353]: segfault at ffffffff ip 000000000058b19f sp 00007ffffa83a8a0 error 4 in php[400000+2c0000]
php[9629]: segfault at ffffffff ip 000000000058b19f sp 00007fff55e23630 error 4 in php[400000+2c0000]
php[11285]: segfault at ffffffff ip 000000000058b19f sp 00007fff2dd525a0 error 4 in php[400000+2c0000]
php[13148]: segfault at ffffffff ip 000000000058b19f sp 00007fff375157a0 error 4 in php[400000+2c0000]
php[14569]: segfault at ffffffff ip 000000000058b19f sp 00007fff90a58d00 error 4 in php[400000+2c0000]
php[15560]: segfault at ffffffff ip 000000000058b19f sp 00007fffa1db0060 error 4 in php[400000+2c0000]
php[17825]: segfault at ffffffff ip 000000000058b19f sp 00007fff33d2b490 error 4 in php[400000+2c0000]
php[18783]: segfault at ffffffff ip 000000000058b19f sp 00007ffff949dcb0 error 4 in php[400000+2c0000]
php[19747]: segfault at ffffffff ip 000000000058b19f sp 00007fff897c3f10 error 4 in php[400000+2c0000]
php[20704]: segfault at ffffffff ip 000000000058b19f sp 00007ffff3083eb0 error 4 in php[400000+2c0000]
php[21667]: segfault at ffffffff ip 000000000058b19f sp 00007fff93bb9a20 error 4 in php[400000+2c0000]
php[22620]: segfault at ffffffff ip 000000000058b19f sp 00007fff28930530 error 4 in php[400000+2c0000]
php[24544]: segfault at ffffffff ip 000000000058b19f sp 00007ffff8e08450 error 4 in php[400000+2c0000]
php[25654]: segfault at ffffffff ip 000000000058b19f sp 00007fffaf874640 error 4 in php[400000+2c0000]
php[26704]: segfault at ffffffff ip 000000000058b19f sp 00007fff7e2283a0 error 4 in php[400000+2c0000]
php[27869]: segfault at ffffffff ip 000000000058b19f sp 00007fffc9e5c8e0 error 4 in php[400000+2c0000]

/var/log/messages – output:

Oct 13 11:23:46 linuxsrv2 kernel: php[2439]: segfault at 6b4bac000 ip 00000000005b41d0 sp 00007fff7d0b9568 error 4 in php[400000+2c0000]
Oct 13 11:23:48 linuxsrv2 abrtd: Directory 'ccpp-2014-10-13-11:23:46-2439' creation detected
Oct 13 11:23:48 linuxsrv2 abrt[2440]: Saved core dump of pid 2439 (/usr/bin/php) to /var/spool/abrt/ccpp-2014-10-13-11:23:46-2439 (85946368 bytes)

Daha dəqiq olaraq test etdikdə:

[root@linuxsrv2 abrt]# /usr/bin/php /usr/share/nginx/html/Grab/index-console.php Test xxxxxxxxxx
Segmentation fault (core dumped)

Core Dump GDB output-a nəzər yetirək:

[root@linuxsrv2 ccpp-2014-10-15-14:25:02-10116]# gdb /usr/bin/php coredump
.
.
.
Core was generated by `/usr/bin/php /usr/share/nginx/html/Grab/index-console.php Test xxxxxxxx'.
Program terminated with signal 11, Segmentation fault.
#0  zend_mm_remove_from_free_list (heap=<value optimized out>, mm_block=0x29fe8c8) at /usr/src/debug/php-5.3.3/Zend/zend_alloc.c:826
826				ZEND_MM_CHECK_TREE(mm_block);

(gdb) bt
#0  zend_mm_remove_from_free_list (heap=<value optimized out>, mm_block=0x29fe8c8) at /usr/src/debug/php-5.3.3/Zend/zend_alloc.c:826
#1  0x000000000058b3b5 in _zend_mm_free_int (heap=0x24372b0, p=0x29fe878) at /usr/src/debug/php-5.3.3/Zend/zend_alloc.c:2019
#2  0x00000000005b4b91 in zend_hash_destroy (ht=0x4e4d1b0) at /usr/src/debug/php-5.3.3/Zend/zend_hash.c:531
#3  0x00000000005a052a in destroy_zend_class (pce=<value optimized out>) at /usr/src/debug/php-5.3.3/Zend/zend_opcode.c:191
#4  0x00000000005b4835 in zend_hash_apply_deleter (ht=0x2437c00, p=0x2aca320) at /usr/src/debug/php-5.3.3/Zend/zend_hash.c:609
#5  0x00000000005b4939 in zend_hash_reverse_apply (ht=0x2437c00, apply_func=0x59b750 <clean_non_persistent_class>)
    at /usr/src/debug/php-5.3.3/Zend/zend_hash.c:758
#6  0x000000000059c45e in shutdown_executor () at /usr/src/debug/php-5.3.3/Zend/zend_execute_API.c:312
#7  0x00000000005a8c22 in zend_deactivate () at /usr/src/debug/php-5.3.3/Zend/zend.c:890
#8  0x0000000000556805 in php_request_shutdown (dummy=<value optimized out>) at /usr/src/debug/php-5.3.3/main/main.c:1634
#9  0x0000000000631214 in main (argc=4, argv=0x7fff232e2158) at /usr/src/debug/php-5.3.3/sapi/cli/php_cli.c:1373

(gdb) bt full
#0  zend_mm_remove_from_free_list (heap=<value optimized out>, mm_block=0x29fe8c8) at /usr/src/debug/php-5.3.3/Zend/zend_alloc.c:826
        rp = <value optimized out>
        cp = <value optimized out>
        prev = 0x2bf12b0
        next = 0x2bf12b0
#1  0x000000000058b3b5 in _zend_mm_free_int (heap=0x24372b0, p=0x29fe878) at /usr/src/debug/php-5.3.3/Zend/zend_alloc.c:2019
        mm_block = 0x29fe868
        next_block = 0x29fe8c8
        size = 96
#2  0x00000000005b4b91 in zend_hash_destroy (ht=0x4e4d1b0) at /usr/src/debug/php-5.3.3/Zend/zend_hash.c:531
        p = 0x4e49b98
        q = 0x29fe878
#3  0x00000000005a052a in destroy_zend_class (pce=<value optimized out>) at /usr/src/debug/php-5.3.3/Zend/zend_opcode.c:191
        ce = 0x4e4d180
#4  0x00000000005b4835 in zend_hash_apply_deleter (ht=0x2437c00, p=0x2aca320) at /usr/src/debug/php-5.3.3/Zend/zend_hash.c:609
        retval = <value optimized out>
#5  0x00000000005b4939 in zend_hash_reverse_apply (ht=0x2437c00, apply_func=0x59b750 <clean_non_persistent_class>)
    at /usr/src/debug/php-5.3.3/Zend/zend_hash.c:758
        result = 1
        p = 0x2aca400
        q = 0x2aca320
#6  0x000000000059c45e in shutdown_executor () at /usr/src/debug/php-5.3.3/Zend/zend_execute_API.c:312
        __orig_bailout = 0x0
        __bailout = {{__jmpbuf = {9618720, 4153135478262045439, 140733783621432, 0, 0, 140733783621432, -4153268429412787457, 4153135458132007679}, 
            __mask_was_saved = 0, __saved_mask = {__val = {44778240, 312, 5813072, 44033256, 81700376, 88, 5813072, 20040, 5813072, 9620224, 9617240, 
                9618536, 0, 0, 5928661, 9620224}}}}
#7  0x00000000005a8c22 in zend_deactivate () at /usr/src/debug/php-5.3.3/Zend/zend.c:890
No locals.
#8  0x0000000000556805 in php_request_shutdown (dummy=<value optimized out>) at /usr/src/debug/php-5.3.3/main/main.c:1634
        report_memleaks = 1 '\001'
#9  0x0000000000631214 in main (argc=4, argv=0x7fff232e2158) at /usr/src/debug/php-5.3.3/sapi/cli/php_cli.c:1373
        exit_status = 0
        c = <value optimized out>
---Type <return> to continue, or q <return> to quit---
        file_handle = {type = ZEND_HANDLE_MAPPED, filename = 0x7fff232e3f38 "/usr/share/nginx/html/Grab/index-console.php", opened_path = 0x0, handle = {
            fd = 40267816, fp = 0x2667028, stream = {handle = 0x2667028, isatty = 0, mmap = {len = 585, pos = 0, map = 0x7ff7457cf000, 
                buf = 0x7ff7457cf000 <Address 0x7ff7457cf000 out of bounds>, old_handle = 0x26908f0, old_closer = 0x5bd500 <zend_stream_stdio_closer>}, 
              reader = 0x5bdb10 <zend_stream_stdio_reader>, fsizer = 0x5bd5b0 <zend_stream_stdio_fsizer>, closer = 0x5bdaa0 <zend_stream_mmap_closer>}}, 
          free_filename = 0 '\000'}
        behavior = <value optimized out>
        reflection_what = <value optimized out>
        orig_optind = 1
        orig_optarg = 0x0
        arg_free = <value optimized out>
        arg_excp = <value optimized out>
        script_file = <value optimized out>
        interactive = <value optimized out>
        module_started = 1
        request_started = 1
        lineno = 1
        exec_direct = <value optimized out>
        exec_run = <value optimized out>
        exec_begin = <value optimized out>
        exec_end = <value optimized out>
        param_error = <value optimized out>
        hide_argv = <value optimized out>
        ini_entries_len = <value optimized out>


zend_mm_heap corrupted
-u isə scripti PHP debug-dan birbaşa alırıq

[root@linuxsrv2 ~]# gdb /usr/bin/php
.
.
(gdb) run /usr/share/nginx/html/Grab/index-console.php Test xxxxx
Starting program: /usr/bin/php /usr/share/nginx/html/Grab/index-console.php Test xxxxx
[Thread debugging using libthread_db enabled]
zend_mm_heap corrupted

Program exited with code 01.

Araşdırmalardan sonra, ortaya çıxdı ki, bu BUG PHP-nin garbage collector-undan irəli gəlir.
Test məqsədilə Garbage Collector-u söndürüb yoxlayaq./etc/php.ini faylına əlavə edirik:

[PHP]
zend.enable_gc = 0

Daha sonra nginx-ə restart veririk və bir daha yoxlayırıq:

(gdb) run /usr/share/nginx/html/Grab/index-console.php Test xxxxxx
Starting program: /usr/bin/php /usr/share/nginx/html/Grab/index-console.php Test xxxxx
[Thread debugging using libthread_db enabled]

Program exited normally.

Ümumiləşdirsək, qarşılaşdığımız BUG üçün workaround: Garbage Collector-u söndürməkdir.

Əgər Global yox məhz müəyyən script üçün söndürmək lazımdırsa o zaman script daxilinə qeyd etmək lazımdır:

ini_set('zend.enable_gc',0);

Təşəkkürlər.

Use Oracle 12c Preinstall RPM with CentOS 6.5

Oracle-ın Linux üzərinə install-ı zamanı, bəzi pre-install addımlar atılmalıdır ki, burda yeni başlayanlara bəzən çətinlik yaradır.
Bu prosesi sadələşdirmək məqsədilə, Oracle 12cR1 üçün preinstall paketini təqdim edir.
Paketin adı: oracle-rdbms-server-12cR1-preinstall
Lakin bu paket yalnız, Oracle Public Yum Repo-da mövcuddur. Sözsüz ki, repo-ni aktivləşdirmək çox sadədir. Problem isə daha ciddidir, bu pre-install paketi dependency error verir (CentOS,Scientific Linux, Red Hat). Daha dəqiq desək Oracle Linux Kernel teleb edir(UEK).
Sınayaq:

Installing:
 oracle-rdbms-server-12cR1-preinstall    x86_64    1.0-8.el6                  /oracle-rdbms-server-12cR1-preinstall-1.0-8.el6.x86_64     37 k
Installing for dependencies:
 compat-libcap1                          x86_64    1.10-1                     base                                                       17 k
 compat-libstdc++-33                     x86_64    3.2.3-69.el6               base                                                      183 k
 kernel-uek                              x86_64    2.6.39-400.215.7.el6uek    ol6_UEK_latest                                             28 M
 kernel-uek-firmware                     noarch    2.6.39-400.215.7.el6uek    ol6_UEK_latest                                            3.7 M
 ksh                                     x86_64    20120801-10.el6_5.9        ol6_latest                                                757 k
 libaio-devel                            x86_64    0.3.107-10.el6             base                                                       13 k
 sysstat                                 x86_64    9.0.4-22.el6_5.1           ol6_latest                                                230 k

Bəli gördüyümüz kimi, kernel-uekkernel-uek-firmware
dependency tələb edir.
Sözsüz ki, 1 distro-da müxtəlif fərqli vendor-dan kernel olmamalıdır.
Nəticə etibarı ilə, biz bu pre-install RPM paketi CentOS-a qurmaq üçün, RPM-i yenidən rebuild etməli, bu əsnada isə UEK dependency-ni silməliyik.

Bütün addımlar aşağıdakı kimidir:

1. Install rpmbuild and related packages

[root@linuxsrv1 ~]#yum install rpm-build rpmdevtools

2. Bütün rebuild işlərini görmək üçün, tets user yaradaq

[root@linuxsrv1 ~]# useradd tester -p tester -m -s /bin/bash
[root@linuxsrv1 ~]# su - tester

3. Oracle pre-install source paketlərini əldə edirik

[tester@linuxsrv1 ~]$ wget http://public-yum.oracle.com/repo/OracleLinux/OL6/latest/x86_64/getPackageSource/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.src.rpm
Saving to: “oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.src.rpm”

100%[====================================================================================================>] 14,075      --.-K/s   in 0.06s   

2014-09-09 22:37:33 (241 KB/s) - “oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.src.rpm” saved [14075/14075]

4. RPMTREE yaradırıq:

[tester@linuxsrv1 ~]$ rpmdev-setuptree
[tester@linuxsrv1 ~]$ ls -l
total 20
-rw-rw-r--. 1 tester tester 14075 Nov 21  2013 oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.src.rpm
drwxrwxr-x. 8 tester tester  4096 Sep  9 22:40 rpmbuild
[tester@linuxsrv1 rpmbuild]$ ls -l
total 24
drwxrwxr-x. 3 tester tester 4096 Sep  9 22:40 BUILD
drwxr-xr-x. 2 tester tester 4096 Sep  9 22:40 BUILDROOT
drwxrwxr-x. 3 tester tester 4096 Sep  9 22:40 RPMS
drwxrwxr-x. 2 tester tester 4096 Sep  9 22:38 SOURCES
drwxrwxr-x. 2 tester tester 4096 Sep  9 22:38 SPECS
drwxrwxr-x. 2 tester tester 4096 Sep  9 22:40 SRPMS

5. src.rpm paketini test user ilə install edirik:

[tester@linuxsrv1 ~]$ rpm -ivh oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.src.rpm
warning: oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.src.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
   1:oracle-rdbms-server-12c########################################### [100%]

6. Dependency hissəsində dəyişiklik edirik:

[tester@linuxsrv1 ~]$ nano rpmbuild/SPECS/oracle-rdbms-server-12cR1-preinstall.spec
#System requirement
Requires:procps module-init-tools ethtool initscripts
Requires:bc bind-utils nfs-utils util-linux-ng pam
Requires:xorg-x11-utils xorg-x11-xauth
#Requires:kernel-uek
Requires:smartmontools

7. Yeni SPEC fayldan RPM-i rebuild edirik:

[tester@linuxsrv1 rpmbuild]$ rpmbuild -ba SPECS/oracle-rdbms-server-12cR1-preinstall.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.iYRCvZ
+ umask 022
+ cd /home/tester/rpmbuild/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ echo RPM_BUILD_ROOT=/home/tester/rpmbuild/BUILDROOT/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64
RPM_BUILD_ROOT=/home/tester/rpmbuild/BUILDROOT/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64
+ cd /home/tester/rpmbuild/BUILD
+ rm -rf oracle-rdbms-server-12cR1-preinstall-1.0
+ /bin/tar -xf -
+ /usr/bin/gzip -dc /home/tester/rpmbuild/SOURCES/oracle-rdbms-server-12cR1-preinstall-1.0.tar.gz
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd oracle-rdbms-server-12cR1-preinstall-1.0
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.kajs7z
+ umask 022
+ cd /home/tester/rpmbuild/BUILD
+ cd oracle-rdbms-server-12cR1-preinstall-1.0
+ LANG=C
+ export LANG
+ unset DISPLAY
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.yw8fMa
+ umask 022
+ cd /home/tester/rpmbuild/BUILD
+ '[' /home/tester/rpmbuild/BUILDROOT/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64 '!=' / ']'
+ rm -rf /home/tester/rpmbuild/BUILDROOT/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64
++ dirname /home/tester/rpmbuild/BUILDROOT/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64
+ mkdir -p /home/tester/rpmbuild/BUILDROOT
+ mkdir /home/tester/rpmbuild/BUILDROOT/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64
+ cd oracle-rdbms-server-12cR1-preinstall-1.0
+ LANG=C
+ export LANG
+ unset DISPLAY
+ rm -rf /home/tester/rpmbuild/BUILDROOT/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64
+ mkdir -p -m 755 /home/tester/rpmbuild/BUILDROOT/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64/etc/sysconfig/oracle-rdbms-server-12cR1-preinstall
+ mkdir -p -m 755 /home/tester/rpmbuild/BUILDROOT/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64/usr/bin
+ mkdir -p -m 755 /home/tester/rpmbuild/BUILDROOT/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64/etc/rc.d/init.d
+ mkdir -p -m 755 /home/tester/rpmbuild/BUILDROOT/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64/etc/security/limits.d
+ mkdir -p -m 700 /home/tester/rpmbuild/BUILDROOT/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64/var/log/oracle-rdbms-server-12cR1-preinstall/results
+ install -m 700 oracle-rdbms-server-12cR1-preinstall-verify /home/tester/rpmbuild/BUILDROOT/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64/etc/sysconfig/oracle-rdbms-server-12cR1-preinstall
+ install -m 700 oracle-rdbms-server-12cR1-preinstall-verify /home/tester/rpmbuild/BUILDROOT/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64/usr/bin
+ install -m 600 oracle-rdbms-server-12cR1-preinstall.param /home/tester/rpmbuild/BUILDROOT/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64/etc/sysconfig/oracle-rdbms-server-12cR1-preinstall
+ install -m 700 oracle-rdbms-server-12cR1-preinstall-firstboot /home/tester/rpmbuild/BUILDROOT/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64/etc/rc.d/init.d
+ touch /home/tester/rpmbuild/BUILDROOT/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64/etc/security/limits.d/oracle-rdbms-server-12cR1-preinstall.conf
+ ln -f -s /etc/sysconfig/oracle-rdbms-server-12cR1-preinstall/oracle-rdbms-server-12cR1-preinstall-verify /home/tester/rpmbuild/BUILDROOT/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64/usr/bin/oracle-rdbms-server-12cR1-preinstall-verify
+ /usr/lib/rpm/find-debuginfo.sh --strict-build-id /home/tester/rpmbuild/BUILD/oracle-rdbms-server-12cR1-preinstall-1.0
+ /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
+ /usr/lib/rpm/brp-python-bytecompile
+ /usr/lib/rpm/redhat/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-java-repack-jars
Processing files: oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64
warning: File listed twice: /etc/sysconfig/oracle-rdbms-server-12cR1-preinstall/oracle-rdbms-server-12cR1-preinstall-verify
warning: File listed twice: /etc/sysconfig/oracle-rdbms-server-12cR1-preinstall/oracle-rdbms-server-12cR1-preinstall.param
Provides: config(oracle-rdbms-server-12cR1-preinstall) = 1.0-11.el6 oracle-rdbms-server-12cR1-preinstall = 1.0
Requires(interp): /bin/sh /bin/sh /bin/sh /bin/sh
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(VersionedDependencies) <= 3.0.3-1
Requires(pre): /bin/sh /etc/redhat-release
Requires(post): /bin/sh
Requires(preun): /bin/sh
Requires(postun): /bin/sh
Requires: /bin/bash
Processing files: oracle-rdbms-server-12cR1-preinstall-debuginfo-1.0-11.el6.x86_64
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/tester/rpmbuild/BUILDROOT/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64
warning: Could not canonicalize hostname: linuxsrv1
Wrote: /home/tester/rpmbuild/SRPMS/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.src.rpm
Wrote: /home/tester/rpmbuild/RPMS/x86_64/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64.rpm
Wrote: /home/tester/rpmbuild/RPMS/x86_64/oracle-rdbms-server-12cR1-preinstall-debuginfo-1.0-11.el6.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.7RHWGH
+ umask 022
+ cd /home/tester/rpmbuild/BUILD
+ cd oracle-rdbms-server-12cR1-preinstall-1.0
+ rm -rf /home/tester/rpmbuild/BUILDROOT/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64
+ exit 0

8. Yeni yaradılmış RPM paketi install edək:

[tester@linuxsrv1 ~]$ cd rpmbuild/RPMS/x86_64/
[tester@linuxsrv1 x86_64]$ ls -l
total 20
-rw-rw-r--. 1 tester tester 15220 Sep  9 22:40 oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64.rpm
-rw-rw-r--. 1 tester tester  3424 Sep  9 22:40 oracle-rdbms-server-12cR1-preinstall-debuginfo-1.0-11.el6.x86_64.rpm
[tester@linuxsrv1 x86_64]$ su -
Password: 
[root@linuxsrv1 ~]# yum localinstall /home/tester/rpmbuild/RPMS/x86_64/oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64.rpm
Dependencies Resolved

==============================================================================================================================================
 Package                                 Arch      Version                   Repository                                                  Size
==============================================================================================================================================
Installing:
 oracle-rdbms-server-12cR1-preinstall    x86_64    1.0-11.el6                /oracle-rdbms-server-12cR1-preinstall-1.0-11.el6.x86_64     38 k
Installing for dependencies:
 compat-libcap1                          x86_64    1.10-1                    base                                                        17 k
 compat-libstdc++-33                     x86_64    3.2.3-69.el6              base                                                       183 k
 ksh                                     x86_64    20120801-10.el6_5.9       updates                                                    757 k
 libaio-devel                            x86_64    0.3.107-10.el6            base                                                        13 k
 sysstat                                 x86_64    9.0.4-22.el6_5.1          updates                                                    230 k

9. Uğurla install edirik

Installed:
  oracle-rdbms-server-12cR1-preinstall.x86_64 0:1.0-11.el6                                                                                    

Dependency Installed:
  compat-libcap1.x86_64 0:1.10-1                compat-libstdc++-33.x86_64 0:3.2.3-69.el6          ksh.x86_64 0:20120801-10.el6_5.9         
  libaio-devel.x86_64 0:0.3.107-10.el6          sysstat.x86_64 0:9.0.4-22.el6_5.1                 

Complete!

10.Uğurlu installdan sonra görürük ki, əvvəllər manual olaraq etdiyimiz bütün addımlar indi avtomatik olaraq yerinə yetirilmişdir:

[root@linuxsrv1 ~]# cat /etc/group | grep oracle
dba:x:54322:oracle
[root@linuxsrv1 ~]# cat /etc/group | grep oinstall
oinstall:x:54321:

[root@linuxsrv1 ~]# cat /etc/sysctl.conf | grep oracle
# oracle-rdbms-server-12cR1-preinstall setting for fs.file-max is 6815744
# oracle-rdbms-server-12cR1-preinstall setting for kernel.sem is '250 32000 100 128'
# oracle-rdbms-server-12cR1-preinstall setting for kernel.shmmni is 4096
# oracle-rdbms-server-12cR1-preinstall setting for kernel.shmall is 1073741824 on x86_64
# oracle-rdbms-server-12cR1-preinstall setting for kernel.shmmax is 4398046511104 on x86_64
# oracle-rdbms-server-12cR1-preinstall setting for net.core.rmem_default is 262144
# oracle-rdbms-server-12cR1-preinstall setting for net.core.rmem_max is 4194304
# oracle-rdbms-server-12cR1-preinstall setting for net.core.wmem_default is 262144
# oracle-rdbms-server-12cR1-preinstall setting for net.core.wmem_max is 1048576
# oracle-rdbms-server-12cR1-preinstall setting for fs.aio-max-nr is 1048576
# oracle-rdbms-server-12cR1-preinstall setting for net.ipv4.ip_local_port_range is 9000 65500

Artıq hazırladığım paketi aşağıdakı linkdən yükləyə bilərsiniz:

12c Preinstall RPM for CentOS

Təşəkkürlər.