Posts Tagged ‘solaris’

Segmentation Fault (core dumped)

September 4th, 2018, posted in Solaris

Segmentation Fault or Segmentation Fault (core dumped)


Segmentation faults usually come from a programming error. This message is usually accompanied by a core dump, except on read-only file systems.


To see which program produced a core(4) file, run either the file(1) command or the adb(1) command. The following examples show the output of the file(1) and adb(1) commands on a core file from the dtmail program.

$ file core
core: ELF 32-bit MSB core file SPARC Version 1, from `dtmail'
$ adb core
core file = core -- program `dtmail'
SIGSEGV  11: segmentation violation
^D      (use Control-d to quit the adb rogram)


Segmentation Fault (core dumped) or Segmentation Fault,Segmentation Fault (core dumped), Segmentation Fault,core dumped,solaris,solaris 10,Solaris Common Messages and Troubleshooting Guide,Solaris Common Messages,Troubleshooting Guide,Solaris Troubleshooting,

Segmentation Fault (core dumped) or Segmentation Fault,Segmentation Fault (core dumped), Segmentation Fault,core dumped,solaris,solaris 10,Solaris Common Messages and Troubleshooting Guide,Solaris Common Messages,Troubleshooting Guide,Solaris Troubleshooting ,


How to manually mount CD-DVD-ROM in Solaris

March 3rd, 2018, posted in Solaris, Uncategorized

Add A User From The Command Line In Solaris,Add A User From The Command Line In Solaris 10,Add A User From The Command Line, In Solaris10 ,Add A User ,The Command Line In Solaris10,The Command Line In Solaris,solaris 10,

Recently while trying to build a Solaris JumpStart server, I encountered an error in reading the home-burnt DVD-ROM disk of Solaris 10 10/08.  There are many threads out on the internet that talk about the same difficulty and issue.  To circumvent the issue, I needed to manually mount the DVD-ROM.  To do this, you first need to disable the volmgmt software in Solaris.  Since I am running Solaris 10, the command is simple:


# svcadm disable volfs
# svcs volfs
STATE          STIME    FMRI
disabled        7:29:01 svc:/system/filesystem/volfs:default
# ps -ef |grep vol
    root 10189   936   0 07:26:10 pts/1       0:00 grep vol


Once that is done, you should be able to mount the DVD-ROM using the following command:


# mount -F hsfs -o ro /dev/sr0 /cdrom
# cd /cdrom
# ls
Copyright                    License                      boot                         platform
JDS-THIRDPARTYLICENSEREADME  Solaris_10                   installer

Once done, don’t forget to re-enable volume management.  That is done by:


# svcadm enable volfs
# svcs volfs
STATE          STIME    FMRI
online          8:33:21 svc:/system/filesystem/volfs:default

Taking explorer on SUN machines

April 21st, 2016, posted in Linux OS

If your system is a SunFire midframe server (38×0, 48×0, or 68×0 model), use this command to include data from the system console:

/opt/SUNWexplo/bin/explorer -q -e -w default,scextended

If your system uses an alom (advanced lights out manager), some additional data can be collected. Systems that use that include:
Sun Fire V210,V240,V250,V245,V440,V440R,V445 Server Netra 240,440 (AC) Server
Use this command:

# /opt/SUNWexplo/bin/explorer -q -e -w default,alomextended


If your system uses T1 processors (system type starts with T, and uname -a command will say architecture is sun4v), use this command:

# /opt/SUNWexplo/bin/explorer -q -e -w default,Tx000

For any other model of Sun system, use this command:

# /opt/SUNWexplo/bin/explorer -q -e


The -q option suppresses printing of error messages during the run.
The -e option prevents explorer from automatically sending email.
The -w scextended option collects data from the system console (sc).

If you cannot run explorer for some reason, here are the most important things to collect:

/var/adm/messages or messages.# file for the time when the crash was taken. Be sure to include any messages that occurred just before panic.

/etc/system file

output of the showrev -p command, for a list of patches on system

Detailed hardware configuration of the system. To determine which command to use, issue the command uname -m to find the system architecture type.

If it is sun4u, send the output of this command:
/usr/platform/sun4u/sbin/prtdiag -v
If it is sun4v, send the output of this command:
/usr/platform/sun4v/sbin/prtdiag -v
Output of this command:
prtconf -vp

If your system is a SunFire midframe server (38×0, 48×0, or 68×0 model), include the output of these commands to collect data from the system console:

showlogs -v
showlogs -d showboards -v showplatform -v showenvironment -v showsc -v

Link :


CRON Troubleshooting Guide

July 15th, 2015, posted in Solaris

Cron facility can be used to schedule regularly occurring commands or scripts. Users can submit cron jobs by adding an entry to their respective crontabs located in /var/spool/cron/crontabs directory and stored as their login name. Below are few of the troubleshooting tips and best practices which can be helpful in many cases.


Important cron files :

The important files related cron are :

— File containing usernames that have permission to submit cronjobs
— File containing usernames that don’t have permission to submit cronjobs
— Cron Log file
— Directory containing individual crontab files of all users.

How to edit a crontab :

The best way to edit a crontab is using the command crontab -e. Another way of doing it is :
1. su to the user whose cron you want to change
2. crontab -l > file [ copy the crontab to a file ].
3. vi file [ make changes to the file as per your need ]
4. crontab file [ this makes the “file” as new crontab ]
There is no need to restart the cron daemon after this.

Note : If by mistake you simple run only crontab command, don’t try to come out by typing CTRL+D as it will remove all the entries in the crontab file. Use CTRL+C to come out of the crontab command.
Check whether cron daemon is running
Check if the cron daemon is running in the system [prior to solaris 10] :

# ps -ef |grep cron
 To start or stop cron daemon use:
# /etc/init.d/cron [stop|start]
 In case of Solaris 10, check the for the cron service status :
# svcs -p svc:/system/cron
 To make sure cron jobs are running properly, add below entry in the crontab.
* * * * * date > /dev/console
 This will print the date every minute to the console. You can also use pts terminal you are working on, if you don’t have the access to console.

Controlling access to crontab :
– The file /etc/cron.d/cron.allow can be used to allow users to submit cron jobs.
– If the cron.allow file is not present cron checks /etc/cron.d/cron.deny file to see which users are not allowed to submit cron jobs.
– If a user is present in both the files, the cron daemon checks the cron.allow file first and ignores the cron.deny file.
– If both files are missing only root can run the jobs.

Check permission and path to the script :
Seems silly, but I have seen many people doing this mistake of not giving executable permissions to the script they want to run from cron.

# chmod u+x /path/to/script

Also make sure that the cron entry has absolute path to the script and also to the shell used by the script:

* 5 * * * /bin/bash /path/to/

Check the cron logs :
Many a time the cron log file /var/cron/log clearly points out the issue in the cronjob. Check for the period in which the scripts should have run in the cron log. this would most probably point out the error in the cronjob.

Be careful when emptying a crontab :
If you delete all the cron jobs using crontab -e, the command crontab -l will still show all the cron jobs. this is because crontab -e does not know what to do with an empty crontab file. So it does not update any changes. The proper way to delete all the jobs from the crontab is :
# crontab -r

Check cron permissions
Sometimes you must have encountered an error “error in message queue open”. One of the reasons of this is a wrong permission to cron and crontab. The proper permissions of cron and crontab are :

# ls -l /usr/sbin/cron
-r-xr-xr-x 1 root sys 57420 Jan 22 2005 /usr/sbin/cron
 # ls -l /usr/bin/crontab
 -r-sr-xr-x 1 root bin 20336 Jan 22 2005 /usr/bin/crontab
 Note the setuid permissions on crontab file.

‘crontab -e’ command returns a number and a ‘?’
Sometimes when you try to edit a crontab file using crontab -e command, it prints a number and a ‘?’. This is because by default the editor used by crontab -e command is the default solaris editor ‘ed’ and not vi editor. When ed starts up it prints the number of characters in the crontab file and does not have a prompt.

To avoid this, simple com out of the ed editor by typing q. Now set the EDITOR environmental variable to vi and run crontab -e again :

# export EDITOR
Password expired for a user :
Many a times cron jobs fail because the password has expired for the user owning the job. In that case you would see below error in the cron log file /var/cron/log :

Authentication token is no longer valid; new one required
CRON (oracle) ERROR: failed to open PAM security session: Success
CRON (oracle) ERROR: cannot set security context
The solution to this problem is to extend the password for the user :

# passwd -x 10 oracle
Redirection / special symbols and their meanings
It is good to know some of the redirection and special symbols being used when adding an entry to the crontab. Any mistake in using them may again lead to a cron job failure. An example of using these symbols in a cron job entry is :

0 5 * * * /bin/bash -l -c ‘export RAILS_ENV=my_env; cd /my_folder; ./script/script.rb 2>&1 > ./log/my_log.log’
Redirection file descriptors
There are 3 standard file descriptors :

1. stdin 0 – Standard input to the program.
2. stdout 1 – Standard output from the program.
3. stderr 2 – Standard error output from the program.
Normally stdin is from the keyboard and stdout and stderr goes to the terminal. But we can redirect it to a file. One of the most commonly used (and confusing) redirection is “2>&1″. It means take the standard error output from the command and send it to the same place where standard output is going.

Other than the most redirection symbols, there are many other symbols used while entering a cron job entry in the crontab :

Used to separate two commands on one line
Run the command in the background
Run the following command only if the previous command completes successfully, (i.e., grep string file && cat file)
“Run the following command only if the previous command did not complete successfully, (i.e., grep string file || echo “”String not found””)”
( )
The command within the parentheses is executed in a subshell

= single forward quote – Don’t assign any special meaning to any character within these quotations

Take the following character literally. Also used to “”escape”” a new-line character so that a user can continue a command on more than one line
” “
Allow variable and command substitution with these quotations
` = single back quote – Take the output of this command and substitute it as an argument on the command line
Everything following # until is a comment


How to create and extract zip, tar, tar.gz and tar.bz2 files in Linux

May 12th, 2015, posted in Solaris

Data compression has been extremely useful to us over the years. Whether its a zip file containing images to be sent in a mail How to create and extract zip tar tar.gz and tar.bz2 files in Linux, Linux,How to create and extract zip,How to create and extract tar,How to create and extract ,create and extract zip,linux,solaris 10,solaris,or a compressed data backup stored on a server, we use data compression to save valuable hard drive space or to make the downloading of files easier. There are compression formats out there which allow us to sometimes compress our data by 60% or more. I’ll run you through using some of these formats to compress and decompress files and directories on a Linux machine. We’ll cover the basic usage of zip, tar, tar.gz and the tar.bz2 formats. These are some of the most popular formats for compression used on Linux machines.

Before we delve into the usage of the formats I’d like to share some of my experience using the various formats of archiving. I’m talking about only a few data compression formats here, and there are many more out there. I’ve realized that I need two or three formats of compression that I’m comfortable using, and stick to them. The zip format is definitely one of them. This is because zip has become the de-facto standard choice for data compression, and it works on Windows as well. I use the zip format for files that I might need to share with Windows users. I like to use the tar.gz format for files that I would only use on my Mac and Linux machines.



Zip is probably the most commonly used archiving format out there today. Its biggest advantage is the fact that it is available on all operating system platforms such as Linux, Windows, and Mac OS, and generally supported out of the box. The downside of the zip format is that it does not offer the best level of compression. Tar.gz and tar.bz2 are far superior in that respect. Let’s move on to usage now.
To compress a directory with zip do the following:

# zip -r directory_to_compress

Here’s how you extract a zip archive:

# unzip



Tar is a very commonly used archiving format on Linux systems. The advantage with tar is that it consumes very little time and CPU to compress files, but the compression isn’t very much either. Tar is probably the Linux/UNIX version of zip – quick and dirty. Here’s how you compress a directory:

# tar -cvf archive_name.tar directory_to_compress

And to extract the archive:

# tar -xvf archive_name.tar.gz

This will extract the files in the archive_name.tar archive in the current directory. Like with the tar format you can optionally extract the files to a different directory:

# tar -xvf archive_name.tar -C /tmp/extract_here/



This format is my weapon of choice for most compression. It gives very good compression while not utilizing too much of the CPU while it is compressing the data. To compress a directory use the following syntax:

# tar -zcvf archive_name.tar.gz directory_to_compress

To decompress an archive use the following syntax:

# tar -zxvf archive_name.tar.gz

This will extract the files in the archive_name.tar.gz archive in the current directory. Like with the tar format you can optionally extract the files to a different directory:

# tar -zxvf archive_name.tar.gz -C /tmp/extract_here/



This format has the best level of compression among all of the formats I’ve mentioned here. But this comes at a cost – in time and in CPU. Here’s how you compress a directory using tar.bz2:

# tar -jcvf archive_name.tar.bz2 directory_to_compress

This will extract the files in the archive_name.tar.bz2 archive in the current directory. To extract the files to a different directory use:

# tar -jxvf archive_name.tar.bz2 -C /tmp/extract_here/

Data compression is very handy particularly for backups. So if you have a shell script that takes a backup of your files on a regular basis you should think about using one of the compression formats you learned about here to shrink your backup size.

Over time you will realize that there is a trade-off between the level of compression and the the time and CPU taken to compress. You will learn to judge where you need a quick but less effective compression, and when you need the compression to be of a high level and you can afford to wait a little while longer.