Hello all,
Hope you’re doing fine!
I was working in a project where client was building Oracle RAC clusters.
They would like to use the oracle-database-preinstall package to make sure their environment is following the requirements and best practices as asked by Oracle.
Why use oracle-database-preinstall package?
When installed, the Oracle Database Preinstallation RPM does the following:
- Automatically downloads* and installs any additional RPM packages needed for installing Oracle Grid Infrastructure and Oracle Database, and resolves any dependencies
- Creates an oracle user, and creates the oraInventory (oinstall) and OSDBA (dba) groups for that user
- As needed, sets sysctl.conf settings, system startup parameters, and driver parameters to values based on recommendations from the Oracle Database Preinstallation RPM program
- Sets hard and soft resource limits
- Sets other recommended parameters, depending on your kernel version
- Sets numa=off in the kernel for Linux x86_64 and Linux aarch64 machines.
*If server has access to download the packages. For environments using a Satellite, it will download from the Satellite.
You can read more about this package here:
About the Oracle Database Preinstallation RPM
OK, the client uses customized IDs for OS groups and OS users, they also would like to add as requirement some additional OS packages, so, during the installation of preinstall package, the preinstall can take care of all extra additional packages they want.
Basically, the client needs a customized preinstall package. Is it possible to do it?
Short and direct answer is: YES!
On this blog post I will show how to customize this package to meet your requirements.
First of all, let’s do some checks on our server to make sure we don’t have the oracle user and also the OS groups for oinstall and dba:
cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:65534:65534:Kernel Overflow User:/:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
tss:x:59:59:Account used for TPM access:/:/sbin/nologin
systemd-coredump:x:999:997:systemd Core Dumper:/:/sbin/nologin
systemd-resolve:x:193:193:systemd Resolver:/:/sbin/nologin
clevis:x:998:994:Clevis Decryption Framework unprivileged user:/var/cache/clevis:/sbin/nologin
unbound:x:997:993:Unbound DNS resolver:/etc/unbound:/sbin/nologin
rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/sbin/nologin
polkitd:x:996:992:User for polkitd:/:/sbin/nologin
libstoragemgmt:x:995:991:daemon account for libstoragemgmt:/var/run/lsm:/sbin/nologin
sssd:x:994:990:User for sssd:/:/sbin/nologin
cockpit-ws:x:993:989:User for cockpit web service:/nonexisting:/sbin/nologin
cockpit-wsinstance:x:992:988:User for cockpit-ws instances:/nonexisting:/sbin/nologin
setroubleshoot:x:991:987::/var/lib/setroubleshoot:/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
chrony:x:990:986::/var/lib/chrony:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
tcpdump:x:72:72::/:/sbin/nologin
pcp:x:989:985:Performance Co-Pilot:/var/lib/pcp:/sbin/nologin
oracle-cloud-agent:x:988:984:Oracle Cloud Agent Service User:/var/lib/oracle-cloud-agent:/usr/sbin/nologin
oracle-cloud-agent-updater:x:987:984:Oracle Cloud Agent Updater Service User:/var/lib/oracle-cloud-agent:/usr/sbin/nologin
ocarun:x:986:984:Oracle Cloud Agent Runcommand Service User:/var/lib/ocarun:/usr/sbin/nologin
opc:x:1000:1000:Oracle Public Cloud User:/home/opc:/bin/bash
You can see some “oracle-cloud” users, this is OK as this is an instance provisioned on OCI (thank you Oracle ACE Program!), but this is just for Oracle Cloud Agent.
Let’s check now the groups:
cat /etc/group
root:x:0:
bin:x:1:
daemon:x:2:
sys:x:3:
adm:x:4:oracle-cloud-agent,oracle-cloud-agent-updater,ocarun,opc
tty:x:5:
disk:x:6:
lp:x:7:
mem:x:8:
kmem:x:9:
wheel:x:10:
cdrom:x:11:
mail:x:12:
man:x:15:
dialout:x:18:
floppy:x:19:
games:x:20:
tape:x:33:
video:x:39:
ftp:x:50:
lock:x:54:
audio:x:63:
users:x:100:
nobody:x:65534:
dbus:x:81:
utmp:x:22:
utempter:x:35:
tss:x:59:clevis
input:x:999:
kvm:x:36:
render:x:998:
systemd-journal:x:190:opc
systemd-coredump:x:997:
systemd-resolve:x:193:
printadmin:x:996:
ssh_keys:x:995:
clevis:x:994:
unbound:x:993:
rpc:x:32:
polkitd:x:992:
libstoragemgmt:x:991:
sssd:x:990:
cockpit-ws:x:989:
cockpit-wsinstance:x:988:
stapusr:x:156:
stapsys:x:157:
stapdev:x:158:
setroubleshoot:x:987:
rpcuser:x:29:
chrony:x:986:
sshd:x:74:
slocate:x:21:
tcpdump:x:72:
pcp:x:985:
oracle-cloud-agent:x:984:oracle-cloud-agent,oracle-cloud-agent-updater,ocarun
opc:x:1000:
So, confirming, we don’t have any oracle user, nor oinstall and dba groups.
One of the requirements regarding packages that client have, is to have installed the tmux package if server is OEL8/RHEL8, or screen package if server is OEL7/RHEL7 (yes, I know, don’t ask me why!).
Let’s check here if we have the package installed:
tmux
-bash: tmux: command not found
rpm -qa |grep tmux
Nope! tmux is not installed.
Checking the OS version:
cat /etc/redhat-release
Red Hat Enterprise Linux release 8.10 (Ootpa)
OK, let’s start working on the customization of our preinstall package.
We will need to use the SOURCE package for preinstall package to make this customization.
You can download it from the following URL:
Once downloaded, copy this source package to the server you will use to make the customization.
Note: this customization is required only on the first time, after the package is customized and the new package is build from this customization, you don’t need to execute the customization steps again, you only will be required to do it again in case you would like to add any extra customized option on your preinstall package.
Once the source package is copied to the server, check if file is in the folder you copied:
[root@test-rpm ~]# cd /tmp
[root@test-rpm tmp]# ls -l
total 32
-rw-r--r--. 1 opc opc 32519 Jan 27 22:57 oracle-database-preinstall-19c-1.0-2.el8.src.rpm
Now, install the source package using RPM:
[root@test-rpm tmp]# rpm -ivh oracle-database-preinstall-19c-1.0-2.el8.src.rpm
Updating / installing...
1:oracle-database-preinstall-19c-1.################################# [100%]
Once the source package is installed, a folder structure will be created under /root/rpmbuild:
[root@test-rpm rpmbuild]# find ./
./
./SOURCES
./SOURCES/oracle-database-preinstall-1.0.tar.bz2
./SPECS
./SPECS/oracle-database-preinstall.spec
Basically, the package will create the SOURCES and SPECS subdirectories under the rpmbuild directory.
Let’s explore a little bit on those directories.
[root@test-rpm tmp]# cd /root
[root@test-rpm ~]# ls -l
total 0
drwxr-xr-x. 4 root root 34 Jan 27 23:00 rpmbuild
[root@test-rpm ~]# cd rpmbuild/
[root@test-rpm rpmbuild]# ls -l
total 0
drwxr-xr-x. 2 root root 52 Jan 27 23:00 SOURCES
drwxr-xr-x. 2 root root 45 Jan 27 23:00 SPECS
As you can check above, we have the SOURCES and SPECS subdirectories.
Let’s now explore SPECS subdirectory:
[root@test-rpm rpmbuild]# cd SPECS
[root@test-rpm SPECS]# ls -l
total 8
-rw-r--r--. 1 root root 5012 Feb 17 2021 oracle-database-preinstall.spec
A file named oracle-database-preinstall.spec is there.
Let’s see the content for this file, the output is truncated to make reading easier:
[root@test-rpm SPECS]# cat oracle-database-preinstall.spec
#GIT_CMT=d095e60294c2dbaf49b3129446ddf210f736e537
%define pname oracle-database-preinstall
%define dbrel 19c
%define configdir /etc/sysconfig
%define logdir /var/log
%define version 1.0
%define release 2%{?dist}
%define name %{pname}-%{dbrel}
%global debug_package %{nil}
Summary: Oracle Database Preinstallation RPM
Name: %{name}
Version: %{version}
Release: 2.el8
License: GPLv2
Vendor: Oracle
Source0: oracle-database-preinstall-1.0.tar.bz2
Provides: %{name} = %{version}
Conflicts: exadata-base
Requires(pre): /etc/redhat-release
Requires: procps module-init-tools ethtool initscripts bind-utils nfs-utils util-linux-ng pam
Requires: xorg-x11-utils xorg-x11-xauth smartmontools
Requires: binutils glibc glibc-devel
Requires: ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel
Requires: make sysstat openssh-clients
Requires: psmisc net-tools unzip bc tar
%if 0%{?el7}
Requires: compat-libcap1
%endif
%if 0%{?el8}
Requires: libnsl openssl-libs
%endif
BuildRequires: bash
BuildRoot: %{_builddir}/%{pname}-%{version}-root
%description
The Oracle Database Preinstallation RPM automatically installs any additional
packages needed for installing Oracle Grid Infrastructure and Oracle Database
and configures your server operating system automatically, including setting
kernel parameters and other basic operating system requirements for install.
So, if you noticed, we have the packages that are required. This means that during the installation of preinstall package, OS will try to install the required packages (main reason for failure on this step is if the server have no access to the YUM repositories).
If you also noticed, you can specify different package names according to the Linux version you are using, on the above content we can see some packages required specifically for el7 (OEL7/RHEL7) version and other packages required for el8 (OEL8/RHEL8) version.
OK, I made a small change on this file, specifically to different package requirements according to the version:
%if 0%{?el7}
Requires: compat-libcap1
Requires: screen
%endif
%if 0%{?el8}
Requires: libnsl openssl-libs
Requires: tmux
%endif
So, as you can see, I made as required the screen package if OS is EL7, and tmux package if OS is EL8.
Good.
Let’s move forward on the exploration. Let’s now check the SOURCES subdirectory:
[root@test-rpm SPECS]# cd ..
[root@test-rpm rpmbuild]# ls -l
total 0
drwxr-xr-x. 2 root root 52 Jan 27 23:00 SOURCES
drwxr-xr-x. 2 root root 45 Jan 27 23:00 SPECS
[root@test-rpm rpmbuild]# cd SOURCES
[root@test-rpm SOURCES]# ls -l
total 24
-rw-r--r--. 1 root root 21492 Feb 17 2021 oracle-database-preinstall-1.0.tar.bz2
We have this BZ2 file for the preinstall. Let’s extract this file:
[root@test-rpm SOURCES]# tar -xvjf oracle-database-preinstall-1.0.tar.bz2
oracle-database-preinstall-1.0/
oracle-database-preinstall-1.0/LICENSE
oracle-database-preinstall-1.0/oracle-database-preinstall-firstboot
oracle-database-preinstall-1.0/oracle-database-preinstall-verify
oracle-database-preinstall-1.0/oracle-database-preinstall.param
oracle-database-preinstall-1.0/spec/
oracle-database-preinstall-1.0/spec/ol6/
oracle-database-preinstall-1.0/spec/ol6/oracle-database-preinstall-18c.spec
oracle-database-preinstall-1.0/spec/ol7/
oracle-database-preinstall-1.0/spec/ol7/oracle-database-preinstall-18c.spec
oracle-database-preinstall-1.0/spec/ol7/oracle-database-preinstall-19c.spec
oracle-database-preinstall-1.0/spec/ol7/oracle-database-preinstall-20c.spec
oracle-database-preinstall-1.0/spec/ol8/
oracle-database-preinstall-1.0/spec/ol8/oracle-database-preinstall-19c.spec
oracle-database-preinstall-1.0/spec/ol8/oracle-database-preinstall-20c.spec
As you can see, now we have a new directory, oracle-database-preinstall-1.0, with some subdirectories and files under it. I will not go over all files here. I will go over only on the files I’d like to make the customizations:
[root@test-rpm SOURCES]# cd oracle-database-preinstall-1.0/
[root@test-rpm oracle-database-preinstall-1.0]# ls -l
total 88
-rw-r--r--. 1 1039 1039 18006 Feb 17 2021 LICENSE
-rw-r--r--. 1 1039 1039 1269 Feb 17 2021 oracle-database-preinstall-firstboot
-rw-r--r--. 1 1039 1039 4254 Feb 17 2021 oracle-database-preinstall.param
-rw-r--r--. 1 1039 1039 55910 Feb 17 2021 oracle-database-preinstall-verify
drwxr-xr-x. 5 1039 1039 39 Feb 17 2021 spec
Let’s check the PARAM file, the output truncated to make the reading easier:
[root@test-rpm oracle-database-preinstall-1.0]# cat oracle-database-preinstall.param
# Oracle-database Parameter config file
#Kernel parameters
kernelcomment:oracle-database-preinstall setting for kernel.shmmax is 4398046511104 on x86_64
kernel:*:*:*:kernel.shmmax:4398046511104
kernelcomment:
kernelcomment:oracle-database-preinstall setting for net.ipv4.ip_local_port_range is 9000 65500
kernel:*:*:*:net.ipv4.ip_local_port_range:9000 65500
kernelcomment:
#Group Names and IDs
#category:arch:processor:kernel:distribution:parameter:recommended-value
group:*:*:*:*:oinstall:54321
group:*:*:*:*:dba:54322
group:*:*:*:*:oper:54323
group:*:*:*:*:backupdba:54324
group:*:*:*:*:dgdba:54325
group:*:*:*:*:kmdba:54326
group:*:*:*:*:racdba:54330
#User name and IDs
#category:arch:processor:kernel:distribution:parameter:recommended-value
username:*:*:*:*:oracle:54321:oinstall,dba,oper,backupdba,dgdba,kmdba,racdba
OK, as you can see, we have some parameters on the file about kernel parameters, we also have the OS groups (oinstall, dba, oper, backupdba, etc…), the OS users (oracle) associated with the groups.
The client would like to:
- Add a customized comment on sysctl.conf;
- Create only the groups oinstall and dba with different IDs than the suggested initially by the preinstall package;
- Create the user as oratest with a specific ID;
- Associate oratest to oinstall and dba groups.
Let’s see the content of the file after this customization, again, output truncated to make reading easier:
kernelcomment:oracle-database-preinstall customized by Vinicius DBA - setting for kernel.shmmax is 4398046511104 on x86_64
kernel:*:*:*:kernel.shmmax:4398046511104
kernelcomment:
kernelcomment:oracle-database-preinstall customized by Vinicius DBA - setting for net.ipv4.ip_local_port_range is 9000 65500
kernel:*:*:*:net.ipv4.ip_local_port_range:9000 65500
kernelcomment:
#Group Names and IDs
#category:arch:processor:kernel:distribution:parameter:recommended-value
group:*:*:*:*:oinstall:1521
group:*:*:*:*:dba:1522
#User name and IDs
#category:arch:processor:kernel:distribution:parameter:recommended-value
username:*:*:*:*:oratest:1521:oinstall,dba
Great!
Well, I’m not going to see the content of each file here.
As an information: this package is very powerful and do a lot of checks during the installation of preinstall package.
Now that we have customized this file, if you remember this file was created after we extracted the BZ2 file, let’s create the BZ2 file again:
[root@test-rpm oracle-database-preinstall-1.0]# cd ..
[root@test-rpm SOURCES]# ls -l
total 24
drwxr-xr-x. 3 1039 1039 158 Jan 27 23:02 oracle-database-preinstall-1.0
-rw-r--r--. 1 root root 21492 Feb 17 2021 oracle-database-preinstall-1.0.tar.bz2
[root@test-rpm SOURCES]# tar -cvjf oracle-database-preinstall-1.0.tar.bz2 oracle-database-preinstall-1.0/
oracle-database-preinstall-1.0/
oracle-database-preinstall-1.0/LICENSE
oracle-database-preinstall-1.0/oracle-database-preinstall-firstboot
oracle-database-preinstall-1.0/oracle-database-preinstall-verify
oracle-database-preinstall-1.0/spec/
oracle-database-preinstall-1.0/spec/ol6/
oracle-database-preinstall-1.0/spec/ol6/oracle-database-preinstall-18c.spec
oracle-database-preinstall-1.0/spec/ol7/
oracle-database-preinstall-1.0/spec/ol7/oracle-database-preinstall-18c.spec
oracle-database-preinstall-1.0/spec/ol7/oracle-database-preinstall-20c.spec
oracle-database-preinstall-1.0/spec/ol7/oracle-database-preinstall-19c.spec
oracle-database-preinstall-1.0/spec/ol8/
oracle-database-preinstall-1.0/spec/ol8/oracle-database-preinstall-20c.spec
oracle-database-preinstall-1.0/spec/ol8/oracle-database-preinstall-19c.spec
oracle-database-preinstall-1.0/oracle-database-preinstall.param
Now that we have created the new BZ2 file, we are good to remove the extracted directory:
[root@test-rpm SOURCES]# rm -rf oracle-database-preinstall-1.0
We are good to build the customized package to be used in all servers.
For this, we need to use the rpmbuild binary, which I don’t have installed on my server at this moment.
So, to install rpmbuild package, as root, you need to run this command, output is truncated to make the reading easier:
[root@test-rpm ~]# dnf install -y rpm-build
Last metadata expiration check: 0:07:54 ago on Mon 27 Jan 2025 10:59:54 PM GMT.
Dependencies resolved.
Complete!
Now, let’s run the rpmbuild to build our package, output truncated to make the reading easier:
[root@test-rpm SOURCES]# cd /root
[root@test-rpm ~]# rpmbuild -ba /root/rpmbuild/SPECS/oracle-database-preinstall.spec
Let’s now check the folder structure again:
./
./SOURCES
./SOURCES/oracle-database-preinstall-1.0.tar.bz2
./SPECS
./SPECS/oracle-database-preinstall.spec
./BUILD
./BUILD/oracle-database-preinstall-1.0
./BUILD/oracle-database-preinstall-1.0/LICENSE
./BUILD/oracle-database-preinstall-1.0/oracle-database-preinstall-firstboot
./BUILD/oracle-database-preinstall-1.0/oracle-database-preinstall-verify
./BUILD/oracle-database-preinstall-1.0/spec
./BUILD/oracle-database-preinstall-1.0/spec/ol6
./BUILD/oracle-database-preinstall-1.0/spec/ol6/oracle-database-preinstall-18c.spec
./BUILD/oracle-database-preinstall-1.0/spec/ol7
./BUILD/oracle-database-preinstall-1.0/spec/ol7/oracle-database-preinstall-18c.spec
./BUILD/oracle-database-preinstall-1.0/spec/ol7/oracle-database-preinstall-20c.spec
./BUILD/oracle-database-preinstall-1.0/spec/ol7/oracle-database-preinstall-19c.spec
./BUILD/oracle-database-preinstall-1.0/spec/ol8
./BUILD/oracle-database-preinstall-1.0/spec/ol8/oracle-database-preinstall-20c.spec
./BUILD/oracle-database-preinstall-1.0/spec/ol8/oracle-database-preinstall-19c.spec
./BUILD/oracle-database-preinstall-1.0/oracle-database-preinstall.param
./RPMS
./RPMS/aarch64
./RPMS/aarch64/oracle-database-preinstall-19c-1.0-2.el8.aarch64.rpm
./SRPMS
./SRPMS/oracle-database-preinstall-19c-1.0-2.el8.src.rpm
./BUILDROOT
As we can notice, there are some additional subdirectories:
- BUILD;
- RPMS;
- SRPMS.
Great!
The built package is under RPMS/aarch64.
Let’s install it and see the magic happening! Output is truncated to make reading easier:
[root@test-rpm ~]# ls -l
total 0
drwxr-xr-x. 8 root root 89 Jan 27 23:08 rpmbuild
[root@test-rpm ~]# cd rpmbuild/
[root@test-rpm rpmbuild]# ls -l
total 0
drwxr-xr-x. 3 root root 44 Jan 27 23:08 BUILD
drwxr-xr-x. 2 root root 6 Jan 27 23:08 BUILDROOT
drwxr-xr-x. 3 root root 21 Jan 27 23:08 RPMS
drwxr-xr-x. 2 root root 52 Jan 27 23:07 SOURCES
drwxr-xr-x. 2 root root 45 Jan 27 23:06 SPECS
drwxr-xr-x. 2 root root 62 Jan 27 23:08 SRPMS
[root@test-rpm rpmbuild]# cd RPMS
[root@test-rpm RPMS]# ls -l
total 0
drwxr-xr-x. 2 root root 66 Jan 27 23:08 aarch64
[root@test-rpm RPMS]# cd aarch64/
[root@test-rpm aarch64]# ls -l
total 32
-rw-r--r--. 1 root root 30784 Jan 27 23:08 oracle-database-preinstall-19c-1.0-2.el8.aarch64.rpm
[root@test-rpm aarch64]# dnf install -y oracle-database-preinstall-19c-1.0-2.el8.aarch64.rpm
Last metadata expiration check: 0:08:55 ago on Mon 27 Jan 2025 10:59:54 PM GMT.
Dependencies resolved.
Installed:
ksh-20120801-267.0.1.el8.aarch64 libICE-1.0.9-15.el8.aarch64 libSM-1.2.3-1.el8.aarch64 libX11-xcb-1.6.8-9.el8_10.aarch64 libXcomposite-0.4.4-14.el8.aarch64 libXi-1.7.10-1.el8.aarch64 libXinerama-1.1.4-1.el8.aarch64 libXmu-1.1.3-1.el8.aarch64
libXrandr-1.5.2-1.el8.aarch64 libXt-1.1.5-12.el8.aarch64 libXtst-1.2.3-7.el8.aarch64 libXv-1.0.11-7.el8.aarch64 libXxf86dga-1.1.5-1.el8.aarch64 libXxf86misc-1.0.4-1.el8.aarch64 libXxf86vm-1.1.4-9.el8.aarch64 libaio-devel-0.3.112-1.el8.aarch64
libdmx-1.1.4-3.el8.aarch64 libnsl-2.28-251.0.2.el8_10.5.aarch64 libstdc++-devel-8.5.0-22.0.1.el8_10.aarch64 oracle-database-preinstall-19c-1.0-2.el8.aarch64 tmux-2.7-3.el8.aarch64 xorg-x11-utils-7.5-28.el8.aarch64 xorg-x11-xauth-1:1.0.9-12.el8.aarch64
Complete!
Now let’s see if tmux package is installed:
[root@test-rpm aarch64]# rpm -qi tmux |grep Date:
Install Date: Mon 27 Jan 2025 11:08:54 PM GMT
Let’s see when it was installed and “who” demanded the installation:
[root@test-rpm aarch64]# dnf history list tmux
ID | Command line | Date and time | Action(s) | Altered
----------------------------------------------------------------------------------------------------------------------
46 | install -y oracle-database-preinstall-19c-1.0-2.el8.aarch64.rpm | 2025-01-27 23:08 | Install | 23
Great, so s we can see that the preinstall package has installed the tmux package.
Let’s now check the OS users:
[root@test-rpm aarch64]# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:65534:65534:Kernel Overflow User:/:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
tss:x:59:59:Account used for TPM access:/:/sbin/nologin
systemd-coredump:x:999:997:systemd Core Dumper:/:/sbin/nologin
systemd-resolve:x:193:193:systemd Resolver:/:/sbin/nologin
clevis:x:998:994:Clevis Decryption Framework unprivileged user:/var/cache/clevis:/sbin/nologin
unbound:x:997:993:Unbound DNS resolver:/etc/unbound:/sbin/nologin
rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/sbin/nologin
polkitd:x:996:992:User for polkitd:/:/sbin/nologin
libstoragemgmt:x:995:991:daemon account for libstoragemgmt:/var/run/lsm:/sbin/nologin
sssd:x:994:990:User for sssd:/:/sbin/nologin
cockpit-ws:x:993:989:User for cockpit web service:/nonexisting:/sbin/nologin
cockpit-wsinstance:x:992:988:User for cockpit-ws instances:/nonexisting:/sbin/nologin
setroubleshoot:x:991:987::/var/lib/setroubleshoot:/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
chrony:x:990:986::/var/lib/chrony:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
tcpdump:x:72:72::/:/sbin/nologin
pcp:x:989:985:Performance Co-Pilot:/var/lib/pcp:/sbin/nologin
oracle-cloud-agent:x:988:984:Oracle Cloud Agent Service User:/var/lib/oracle-cloud-agent:/usr/sbin/nologin
oracle-cloud-agent-updater:x:987:984:Oracle Cloud Agent Updater Service User:/var/lib/oracle-cloud-agent:/usr/sbin/nologin
ocarun:x:986:984:Oracle Cloud Agent Runcommand Service User:/var/lib/ocarun:/usr/sbin/nologin
opc:x:1000:1000:Oracle Public Cloud User:/home/opc:/bin/bash
oratest:x:1521:1521::/home/oratest:/bin/bash
We can see that user oratest is now created with the customized ID.
Let’s check the groups:
[root@test-rpm aarch64]# cat /etc/group
root:x:0:
bin:x:1:
daemon:x:2:
sys:x:3:
adm:x:4:oracle-cloud-agent,oracle-cloud-agent-updater,ocarun,opc
tty:x:5:
disk:x:6:
lp:x:7:
mem:x:8:
kmem:x:9:
wheel:x:10:
cdrom:x:11:
mail:x:12:
man:x:15:
dialout:x:18:
floppy:x:19:
games:x:20:
tape:x:33:
video:x:39:
ftp:x:50:
lock:x:54:
audio:x:63:
users:x:100:
nobody:x:65534:
dbus:x:81:
utmp:x:22:
utempter:x:35:
tss:x:59:clevis
input:x:999:
kvm:x:36:
render:x:998:
systemd-journal:x:190:opc
systemd-coredump:x:997:
systemd-resolve:x:193:
printadmin:x:996:
ssh_keys:x:995:
clevis:x:994:
unbound:x:993:
rpc:x:32:
polkitd:x:992:
libstoragemgmt:x:991:
sssd:x:990:
cockpit-ws:x:989:
cockpit-wsinstance:x:988:
stapusr:x:156:
stapsys:x:157:
stapdev:x:158:
setroubleshoot:x:987:
rpcuser:x:29:
chrony:x:986:
sshd:x:74:
slocate:x:21:
tcpdump:x:72:
pcp:x:985:
oracle-cloud-agent:x:984:oracle-cloud-agent,oracle-cloud-agent-updater,ocarun
opc:x:1000:
oinstall:x:1521:oratest
dba:x:1522:oratest
We can see that now we have oinstall and dba groups created with the customized IDs.
Let’s check the user oratest directly:
[root@test-rpm aarch64]# id oratest
uid=1521(oratest) gid=1521(oinstall) groups=1521(oinstall),1522(dba)
[root@test-rpm aarch64]#
[root@test-rpm aarch64]#
OK, let’s check the content of /etc/sysctl.conf, output truncated to make reading easier:
[root@test-rpm aarch64]# cat /etc/sysctl.conf
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
# oracle-database-preinstall-19c customized by Vinicius DBA - setting for kernel.shmmax is 4398046511104 on x86_64
kernel.shmmax = 4398046511104
# oracle-database-preinstall-19c customized by Vinicius DBA - setting for net.ipv4.ip_local_port_range is 9000 65500
net.ipv4.ip_local_port_range = 9000 65500
Excellent!
So, now you have a customized RPM package for the oracle-preinstall package!
Note 1:
As reference, you can use the out-of-box package (with no customization) if you want.
If you are using OEL8, you can simply run this command:
dnf install -y oracle-database-preinstall-19c
If you are using RHEL8 or CentOS8, you can pick up the RPM from the OL8 repository and install it:
Note 2:
If you are interested creating RPM packages, you can follow this simple and good example:
How to create a Linux RPM package
https://www.redhat.com/en/blog/create-rpm-package
Hope it helps!
Peace!
Vinicius