Archive for the ‘Linux OS’ Category

Last Command Examples For Linux And Unix

May 8th, 2022, posted in Solaris
Share

How to find out last logins of users and times informations on Linux/Unix-like operating systems ?

You need to use the last command to show who has recently used the server and logged in and out date/time.

 

The last command reads listing of last logged in users from the system file called /var/log/wtmp or the file designated by the -f options.

Purpose

To find out when a particular user last logged in to the Linux or Unix server.

Syntax

The basic syntax is:

last
last [userNameHere] last [tty] last [options] [userNameHere]

If no options provided last command displays a list of all users logged in (and out) since /var/log/wtmp file was created. You can filter out results by supplying names of users and tty’s to show only those entries matching the username/tty.

last command examples

To find out who has recently logged in and out on your server, type:
$ last
Sample outputs:

root     pts/1        10.1.6.120       Tue Jan 28 05:59   still logged in   
root     pts/0        10.1.6.120       Tue Jan 28 04:08   still logged in   
root     pts/0        10.1.6.120       Sat Jan 25 06:33 - 08:55  (02:22)    
root     pts/1        10.1.6.120       Thu Jan 23 14:47 - 14:51  (00:03)    
root     pts/0        10.1.6.120       Thu Jan 23 13:02 - 14:51  (01:48)    
root     pts/0        10.1.6.120       Tue Jan  7 12:02 - 12:38  (00:35)    
 
wtmp begins Tue Jan  7 12:02:54 2014

You can specifies a file to search other than /var/log/wtmp using -f option. For example, search /nas/server/webserver/.log/wtmp:
$ last -f /nas/server/webserver/.log/wtmp
last -f /nas/server/webserver/.log/wtmp userNameHere

List all users last logged in/out time

last command searches back through the file /var/log/wtmp file and the output may go back to several months. Just use the less command or more command as follows to display output one screen at a time:
$ last | more
last | less

List a particular user last logged in

To find out when user vivek last logged in, type:
$ last vivek
$ last vivek | less
$ last vivek | grep 'Thu Jan 23'


Sample outputs:

Fig. 01 Displaying out when user vivek last logged in on server

Fig. 01 Displaying out when user vivek last logged in on server

Share

Oracle Solaris Includes Ksplice

April 8th, 2022, posted in Solaris
Share

Look what we have here :

-bash-5.0$ pkg list ksplice
NAME (PUBLISHER)     VERSION                    IFO
system/ksplice       11.4-11.4.29.0.1.82.3      i--

 

Ksplice supports online Kernel Updates.

Oracle Support delivers in rare cases of Kernel issues
an IDR which are installed online using ksplice.

For a Solaris Admin such an IDR is handled like other IDRs.
It can be installed as usual with the pkg command.

 

Here a sample:

# pkg info -g ./idr4712.1.p5p idr4712
          Name: idr4712
       Summary: To back out This IDR : # /usr/bin/pkg uninstall -r idr4712
   Description: sparc IDR built for release : Solaris 11.4 SRU # 29.82.3
         State: Not installed
     Publisher: solaris
       Version: 1
        Branch: None
Packaging Date: February 12, 2021 at 10:22:38 AM
          Size: 4.08 kB
          FMRI: pkg://solaris/idr4712@1:20210212T102238Z


-bash-5.0$ pkg list -g ./idr4712.1.p5p -af
NAME (PUBLISHER)         VERSION                      IFO
idr4712                  1                            ---
system/kernel/platform   11.4-11.4.29.0.1.82.3.4712.1 ---
system/ksplice           11.4-11.4.29.0.1.82.3.4712.1 ---
system/osnet-splice      11.4-11.4.29.0.1.82.3.4712.1 ---


# pkg set-publisher -g file:///var/tmp/idr4712.1.p5p solaris

# pkg install idr4712
          Packages to install:   2
            Packages to update:   2
            Services to change:   3
       Create boot environment:  No
Create backup boot environment: Yes
..
..
..

Using spliceadm you can verify the installed splices.

# spliceadm
ID        STATE        CVE             BUGID
471201    applied      N/A             32407818

 

in case of a problem you can even revert the fix

# spliceadm reverse 471201
Splice 471201 reversed successfully on Fri Apr 23 13:15:20.

# spliceadm status
ID        STATE        CVE             BUGID
471201    not-applied  N/A             32407818

 

Another powerful and easy to use Solaris Feature

Share

How Adjust Time Quickly at Boot on Solaris Servers

March 20th, 2022, posted in Solaris
Share

On Solaris 11.4 NTP does update the time after boot.
By default this can take a few minutes, because the NTP client
waits for a few reply’s of the NTP servers.

To update the time quickly it is recommended to use the ‘burst iburst’
flags in the ntp.conf

server <ntpserverip> burst iburst

Using this configuration NTP adjusts the time a few seconds after start.
This is an important configuration if you start your apps or databases automatically.

Share

SWAP size Adding While installing a Oracle Database 19c on Oracle Linux

January 30th, 2022, posted in Oracle, Solaris
Share

SWAP size Adding While installing a Oracle Database 19c on Oracle Linux,SWAP size Adding,installing a Oracle Database 19c,Oracle Linux,Oracle,Linux

SWAP Size Adding  size while installing a Oracle Database 19c on Oracle Linux

Below is the error message I received while I was trying to install Oracle Database 19c on Oracle Linux 7.

PRVF-7573 : Sufficient swap size is not available on node

As per my error on the installer screen I needed 16GB of SWAP space where as my system has just 4GB. So I need to add a swap file for the installation to continue. 

Below steps will outline the steps for the same.

dd if=/dev/sdb of=/tmp/swap01 bs=1K count=16M
chmod 600 /tmp/swap01
mkswap /tmp/swap01
swapon /tmp/swap01

Make sure the bs (*) count is equal to your required SWAP space. Also, the /dev/sdb has enough storage as needed

Share

ISSUE WITH UPLOADING FIRMWARE TO THE SERVICE PROCESSOR(Sysfwdownload: Download Failure – Status = 2)

November 27th, 2021, posted in Solaris
Share

ISSUE WITH UPLOADING FIRMWARE TO THE SERVICE PROCESSOR(Sysfwdownload: Download Failure – Status = 2)

 

Tried to load a firmware package from solaris 10 to the Service Processor on a T5240 machine and it failed with status = 2. Most of the time the issue will be due to the service processor being slow, having too many stale connections. There might be few other things which contributes to the issue. Check the solutions below, if this is not the issue you are seeing then you will have to contact oracle support with the snapshot of ilom, server patch level and the commands you are running.

 

ISSUE:
# pwd
/var/tmp/147310-08

ls -ltr
total 31406

-r–r–r– 1 root root 183 Sep 10 2012 LEGAL_LICENSE.TXT
-rwxr-xr-x 1 root root 8196 Jan 21 2013 sysfwdownload.README
-rwxr-xr-x 1 root root 21308 Jan 21 2013 sysfwdownload
-rwxr-xr-x 1 root root 184 Jan 21 2013 license.txt
-rwxr-xr-x 1 root root 11821 Jan 21 2013 Install.info
-rwxr-xr-x 1 root root 72 Jan 21 2013 copyright
-rwxr-xr-x 1 root root 15990784 Jan 21 2013 Sun_System_Firmware-7_4_5-SPARC_Enterprise_T5140+T5240.pkg
-rwxr-xr-x 1 root root 1291 Jan 21 2013 SPARC_Enterprise_T5140+T5240_metadata.xml
-rw-r–r– 1 root root 12781 Feb 10 2013 README.147310-08
-rw-r–r– 1 root root 19426 Feb 10 2013 147310-08.html

./sysfwdownload Sun_System_Firmware-7_4_5-SPARC_Enterprise_T5140+T5240.pkg
sysfwdownload: download failure – status = 2


SOLUTION 1:
Login to the ILOM/SC and reset the service processor.
sc>resetsc
Are you sure you want to reset the SC (y/n)? y
Performing reset on the SC
Once the service processor is up, now try to load the firmware from solaris operating system to the service processor.
#cd /var/tmp/147310-08
./sysfwdownload Sun_System_Firmware-7_4_5-SPARC_Enterprise_T5140+T5240.pkg
If resetting service processor didn’t help then see solution 2 is applicable for you.


SOLUTION 2:
You have to login to the ilom using “sunservice” account and your ilom user password. If the SP is running a 7.1.x based FW release (ILOM 2.0), the sunservice account is present by default and you can login directly (there is no need for getting an escalation mode key)
After you login to the ilom with the “sunservice” account, check the output of df -h and see if /coredump file system is filled up. If its filled up then this might be your issue.
Login: sunservice
Password: <enter your regular ilom user password here>

Copyright 2007 Sun Microsystem, Inc. All rights reserved.
WARNING: The “sunservice” account is provided solely to allow
Sun Services to perform diagnosis and recovery tasks. Customer use of
the “sunservice” account may interfere with the correct operation of
ILOM and is not supported other than to perform recovery procedures as
documented by Sun Microsystems. Normal ILOM operations should always be
performed using the root account. Further usage of the “sunservice”
account implies your agreement with these terms.
[(flash)root@myilom:~]# df -h

Filesystem                Size      Used Available Use% Mounted on
/dev/mtdblock4            9.7M      9.7M         0 100% /
sshi                     1.0M    308.0k    716.0k  30% /var
sshimi                   1.0M    372.0k    652.0k  36% /var/log
tmpfs                    62.3M         0     62.3M   0% /dev/shm
/dev/tffsa1              31.0M     29.1M    258.0k  99% /store
/dev/loop0               23.2M      4.9M     17.1M  22% /persist
/dev/loop1                3.9M      1.1M      2.5M  31% /conf
/dev/tffsa3              53.0M     53.0M         0 100% /coredump

cd to the coredump directory and remove the files with *core*. Do Not remove any other files which doesn’t contain *core* in the file name.
After removal:
[(flash)root@myilom:/coredump]# df -h

Filesystem                Size      Used Available Use% Mounted on
/dev/mtdblock4            9.7M      9.7M         0 100% /
sshi                     1.0M    308.0k    716.0k  30% /var
sshimi                   1.0M    384.0k    640.0k  38% /var/log
tmpfs                    62.3M         0     62.3M   0% /dev/shm
/dev/tffsa1              31.0M     29.1M    258.0k  99% /store
/dev/loop0               23.2M      4.9M     17.1M  22% /persist
/dev/loop1                3.9M      1.1M      2.5M  31% /conf
/dev/tffsa3              53.0M      4.0M     46.2M   8% /coredump

Now try to load the firmware from the solaris operating system to the service processor.

#cd /var/tmp/147310-08
./sysfwdownload Sun_System_Firmware-7_4_5-SPARC_Enterprise_T5140+T5240.pkg
Share