Escolar Documentos
Profissional Documentos
Cultura Documentos
How many run levels are there and what are they?
There are eight run levels in Solaris. They are
Run level State
0
power down
s or S
single User
1
Administrative
2
Multi-User
3
Multi-use with NFS
4
Alternative Multi-user
5
Power down
6
Reboot
1.Become a superuser or root user to terminate the process of the another user.
2.Obtain the PID of the process to be terminated.
Syntax: $ps fu <username>
Example: $ps fu abc
abc 325 322 3 jan 12 ? 11:04 /usr/openwin/bin/sun
The process ID is displayed in the first column of the output.
Terminate the process using kill command.
$ kill <signal number> pid
Default signal number is -15 {SIGKILL}
-9 {SIGTERM}
Verifying if the process is terminated or not.
$pgrep <pid>
Syntax: $ ps [-efc]
-ef full information about executed process
-c process schedule information
PPID Parent processs ID
Example: ps ef
Output: root 12066 12036 19:44 pts/2
Here 12066 is PID and 12036 is Parent Process ID.
18. What are the differences between the command line and graphical user
interface?
The CLI or the command line interface allows a user to type commands into a terminal or console
window to interact with the operating system. The user has to enter the command or a series of
command for each task that the user wants to be performed.
The GUI or the graphical user interface on the other hand uses graphics in tandem with the keyboard
and a mouse to give the user an easy to use interface to use the program. The gui provides the user
with windows , menus , buttons , scrollbars etc to enbale the users to interact with the operating
system.
The most common tpyes of gui interfaces provided by solaris is the CDE ( common desktop
environment ) and the GNOME desktop. Both the gui`s provide similar functionality to the user to use
the operating system.
19. How can a user login to solaris? What is the login shell?
The solaris platform is a very secure platform and it requires the user to enter his login information
prior to starting any work in the operating system. Before a user login to his account the screen would
show the following prompt:
hostname console login: Rohit
On pressing return the user is asked to enter the password for his account. In order to prevent the
password from being detected by someone else the system does not scho the password on the
display screen. When a user issues a command ot the operating system via the terminal or the gui the
user is actually providing the information to the command interpretation system also known as the
shell. The shell takes all the user inputs and makes sure they are executed properly by the os. The
default shell for solaris systems is the Bourne shell.
There are various other shells supported by solaris such as:
GNU Bourne shell again.
C shell
Korn shell etc.
When the user initially logs into the system and the sees the command prompt , it means that the
shell program has been initiated.This shell is called the login shell.
20. How can the output be redirected to some other action process in place
showing it in the screen?
Solaris allows the user to redirect the output of an operation to a file or something else if required. For
ex.
$ date > sample.file
$
The above command upon execution would cause the output of the date command to redirect to a
new file sample.file.
Another type of requirement is that the user might want to use the output of a particular operation to
act as the input of another operation. This can be achieved in solaris by making use of the pipe (|). A
set of commands which are tied up together like this are called pipelines. An example depicting the
use of the pipes:
$ date | lp
request id is jetprint-46
21. How can the user in solaris check the status of processes?
Once the system interprets a command the system simply creates an independent process with a
unique PID assigned to that process. To keep the track of each process the system uses the PID. In
case the user wants to find out the processes that are currently running on the system the user can
use the ps command. The ps command on execution displays the:
-PID of the processess.
- The terminal from which a process was started
- The cpu time that the process has used so far.
The variable meanings:
O : this implies that the process is running on a processor.
S : This implies that the process is currently sleeping and waiting for an event to complete.
R: This implies that the process is in the run queue.
I : Implies the process is being created.
Z: Implies the process is zombie ie. it has terminated.
T: implies that the process is stopped as the parent was tracing it.
X: The process is waiting for more primary memory.
16) How will you repair the main superblock if it gets corrupted?
A) Every file system has backup superblock at block no.32, which can be given to
fsck to repair the main superblock.
# fsck o b=32 /dev/rdsk/c0t0d0s0
17) How to create new file systems ?
A) newfs /dev/rdsk/c0t0d0s0
18) How will you restore /etc/vfstab file if it gets corrupted?
A) Step 1 : Insert Solaris CD 1 of 2
Step 2 : Go to single user mode : ok boot cdrom s
Step 3 : Run "fsck" on /(root) partition : # fsck /dev/rdsk/c0t0d0s0
Step 4 : Mount /(root) file system on /a directory to gain access to file system
# mount /dev/dsk/c0t0d0s0 /a
Step 5 : Set & export TERM variable
# TERM=sun
# export TERM
Step 6 : Edit /etc/vfstab file and remove the incorrect entry : # vi /a/etc/vfstab
Step 7 : Unmount the file system : # cd / ; # umount /a and reboot the system.
19) How will you share user's home directory?
A) Step 1 : Login as root and verify mountd daemon is running
# ps ef grep mountd
Step 2 : If the daemon is not running start it :
# /etc/init.d/nfs.server start
Step 3 : List all shared filesystems
# share
Step 4 : Edit the /etc/dfs/dfstab file and add :
# share F nfs /export/home
Step 5 : Share the file systems in the /etc/dfs/dfstab file :
# shareall F nfs
Step 6 : Verify that the home directory is shared.
# share
20) What does /etc/inittab file contain ?
A) The /etc/inittab contains the systems default run level, processes to
start/monitor
or restart. It also contains the actions to be taken when run level changes.
/etc/inittab file is in foll format :- id:rstate:action:process
21) How will you use "shutdown" command?
A) # shutdown i0 g300 y
22) How will you check the OBP version of your system ?
A) Use " banner" command at the ok prompt