Mandalika's scratchpad [ Work blog @Oracle | Stock Market Notes | My Music Compositions ]

Old Posts: 09.04  10.04  11.04  12.04  01.05  02.05  03.05  04.05  05.05  06.05  07.05  08.05  09.05  10.05  11.05  12.05  01.06  02.06  03.06  04.06  05.06  06.06  07.06  08.06  09.06  10.06  11.06  12.06  01.07  02.07  03.07  04.07  05.07  06.07  08.07  09.07  10.07  11.07  12.07  01.08  02.08  03.08  04.08  05.08  06.08  07.08  08.08  09.08  10.08  11.08  12.08  01.09  02.09  03.09  04.09  05.09  06.09  07.09  08.09  09.09  10.09  11.09  12.09  01.10  02.10  03.10  04.10  05.10  06.10  07.10  08.10  09.10  10.10  11.10  12.10  01.11  02.11  03.11  04.11  05.11  07.11  08.11  09.11  10.11  11.11  12.11  01.12  02.12  03.12  04.12  05.12  06.12  07.12  08.12  09.12  10.12  11.12  12.12  01.13  02.13  03.13  04.13  05.13  06.13  07.13  08.13  09.13  10.13  11.13  12.13  01.14  02.14  03.14  04.14  05.14  06.14  07.14  09.14  10.14  11.14  12.14  01.15  02.15  03.15  04.15  06.15  09.15  12.15  01.16  03.16  04.16  05.16  06.16  07.16  08.16  09.16  12.16  01.17  02.17  03.17  04.17  06.17  07.17  08.17  09.17 


Saturday, April 02, 2005
 
Solaris: Useful Commands - 1

pargs
___________________________

Prints process arguments, environment variables; pargs can examine both processes and their core files

eg.,
% ps -eaf | grep mozilla-bin
techno 11723 11704 0 22:05:35 ? 2:51
/usr/sfw/bin/../lib/mozilla/mozilla-bin -UILocale en-US -contentLocale US

% pargs 11723
11723: /usr/sfw/bin/../lib/mozilla/mozilla-bin -UILocale en-US -contentLocale US
argv[0]: /usr/sfw/bin/../lib/mozilla/mozilla-bin
argv[1]: -UILocale
argv[2]: en-US
argv[3]: -contentLocale
argv[4]: US

% pargs -e 11723
11723: /usr/sfw/bin/../lib/mozilla/mozilla-bin -UILocale en-US -contentLocale US
envp[0]: AB_CARDCATALOG=/usr/dt/share/answerbooks/C/ab_cardcatalog
envp[1]: ADDON_PATH=/usr/sfw/bin/../lib/mozilla
envp[2]: DISPLAY=:0.0
envp[3]: DTAPPSEARCHPATH=/export/home/techno/.dt/appmanager:/etc/dt/appconfig/appmanager/%L:
/etc/dt/appconfig/appmanager/C:/usr/dt/appconfig/appmanager/%L:/usr/dt/appconfig/appmanager/C
envp[4]: DTDATABASESEARCHPATH=/export/home/techno/.dt/types,/etc/dt/appconfig/types/
%L,/etc/dt/appconfig/types/C,/usr/dt/appconfig/types/%L,/usr/dt/appconfig/types/C
envp[5]: DTDEVROOT=
envp[6]: DTSOURCEPROFILE=true
envp[7]: DTUSERSESSION=techno-unknown-0
envp[8]: DTXSERVERLOCATION=local
...

svcs
___________________________

Reports status of service(s); useful for debugging service issues

svcs with -x option, displays the states of services which:
-v option along with -x, displays verbose information

eg.,
% svcs -x
svc:/application/print/server:default (LP print server)
State: disabled since Tue Mar 22 01:51:18 2005
Reason: Disabled by an administrator.
See: http://sun.com/msg/SMF-8000-05
See: lpsched(1M)
Impact: 2 dependent services are not running. (Use -v for list.)

% svcs -xv
svc:/application/print/server:default (LP print server)
State: disabled since Tue Mar 22 01:51:18 2005
Reason: Disabled by an administrator.
See: http://sun.com/msg/SMF-8000-05
See: man -M /usr/share/man -s 1M lpsched
Impact: 2 dependent services are not running:
svc:/application/print/rfc1179:default
svc:/application/print/ipp-listener:default

-a option, displays all services including the offline/disabled ones

eg.,
% svcs -a
STATE STIME FMRI
legacy_run Mar_22 lrc:/etc/rcS_d/S50sk98sol
legacy_run Mar_22 lrc:/etc/rc2_d/S20sysetup
legacy_run Mar_22 lrc:/etc/rc2_d/S40llc2
disabled Mar_22 svc:/network/dhcp-server:default
disabled Mar_22 svc:/network/ipfilter:default
disabled Mar_22 svc:/network/security/kadmin:default
online Mar_22 svc:/system/filesystem/minimal:default
online Mar_22 svc:/system/rmtmpfiles:default
online Mar_22 svc:/system/keymap:default
online Mar_22 svc:/system/name-service-cache:default
offline Mar_22 svc:/application/print/ipp-listener:default
offline Mar_22 svc:/application/print/rfc1179:default

-p option lists processes associated with each service instance

eg.,
% svcs -p network/telnet:default
STATE STIME FMRI
online Mar_22 svc:/network/telnet:default


svcadm
___________________________

Services can be enabled/disabled with svcadm

Lets check the state of ftp server, and enable/disable it depending on its current state
% svcs -p network/ftp:default
STATE STIME FMRI
online Mar_22 svc:/network/ftp:default

% ftp localhost
Connected to localhost.
220 unknown FTP server ready.
Name (localhost:techno): techno
331 Password required for techno.
Password:
^C

Since FTP server is up, let's disable the service using svcadm command

eg.,
% svcadm disable /network/ftp

% svcs -p network/ftp:default
STATE STIME FMRI
disabled 2:12:04 svc:/network/ftp:default

% ftp localhost
ftp: connect to address 127.0.0.1: Connection refused
Trying ::1...
ftp: connect: Network is unreachable
ftp> bye

It is very easy to enable the service again with svcadm

% svcadm enable /network/ftp

% svcs -p network/ftp:default
STATE STIME FMRI
online 2:14:08 svc:/network/ftp:default

At this point, though the ftp service is available, no processes are associated with the service instance. If we "ftp localhost" from another window, we can then see the ftp daemon:

% svcs -p network/ftp:default
STATE STIME FMRI
online 2:14:08 svc:/network/ftp:default
2:16:27 11976 in.ftpd

smc
___________________________

Solaris Management Console, a Graphical User Interface (GUI) that provides access to Solaris system administration tools.
This tool is comparable to YaST2 of SuSE Linux Or X-Configs of RedHat

pfiles
___________________________

Reports fstat() & fcntl() information for all open files in a process, including their paths

eg.,
% ps -eaf | grep xchat
techno 7958 7945 12 Mar 28 pts/4 361:05 xchat
root 12022 11958 0 02:31:05 pts/4 0:00 grep xchat

% pfiles 7958
7958: xchat
Current rlimit: 256 file descriptors
0: S_IFCHR mode:0620 dev:270,0 ino:12582924 uid:100 gid:7 rdev:24,4
O_RDWR|O_LARGEFILE
/devices/pseudo/pts@0:4
1: S_IFCHR mode:0620 dev:270,0 ino:12582924 uid:100 gid:7 rdev:24,4
O_RDWR|O_LARGEFILE
/devices/pseudo/pts@0:4
2: S_IFCHR mode:0620 dev:270,0 ino:12582924 uid:100 gid:7 rdev:24,4
O_RDWR|O_LARGEFILE
/devices/pseudo/pts@0:4
3: S_IFDOOR mode:0444 dev:279,0 ino:59 uid:0 gid:0 size:0
O_RDONLY|O_LARGEFILE FD_CLOEXEC door to nscd[104]
/var/run/name_service_door
4: S_IFSOCK mode:0666 dev:276,0 ino:37799 uid:0 gid:0 size:0
O_RDWR|O_NONBLOCK FD_CLOEXEC
SOCK_STREAM
SO_SNDBUF(16384),SO_RCVBUF(5120)
sockname: AF_UNIX
peername: AF_UNIX /tmp/.X11-unix/X0
5: S_IFSOCK mode:0666 dev:276,0 ino:45917 uid:0 gid:0 size:0
O_RDWR|O_NONBLOCK
SOCK_STREAM
SO_SNDBUF(49152),SO_RCVBUF(49152)
6: S_IFSOCK mode:0666 dev:276,0 ino:27017 uid:0 gid:0 size:0
O_RDWR|O_NONBLOCK
SOCK_STREAM
SO_REUSEADDR,SO_SNDBUF(49152),SO_RCVBUF(49152)
sockname: AF_INET 0.0.0.0 port: 4000
7: S_IFREG mode:0600 dev:102,7 ino:1237 uid:100 gid:1 size:8435712
O_RDONLY|O_LARGEFILE
/export/home/techno/Siebel77_on_Solaris10.sxw

isainfo
___________________________

Describes the underlying instruction set architecture

isainfo prints the name(s) of the native instruction sets for applications supported by the current version of the operating system.

With -v option, we can find out whether 64-bit applications are supported, or whether the running kernel uses 32-bit or 64-bit device drivers

eg.,
% isainfo
i386

% isainfo -v
32-bit i386 applications
sse2 sse fxsr mmx cmov sep cx8 tsc fpu

who
___________________________

-b option, shows the time and date of the last reboot

eg.,
% who -b
. system boot Mar 22 01:51


-r can be used to get the current run level of the init process
% who -r
. run-level 3 Mar 22 01:51 3 0 S

with -d option, who displays all processes that have expired and not been respawned by init. The exit field appears for dead processes and contains the termination and exit values of the dead process. This can be useful in determining why a process terminated.

# who -dH
NAME LINE TIME
techno pts/5 Mar 25 00:58
techno pts/7 Mar 28 00:05
techno pts/8 Mar 27 19:19
techno pts/6 Apr 2 02:08 (localhost)

uptime
___________________________

Shows how long the system has been up

uptime command prints the current time, the length of time the system has been up, and the average number of jobs in the run queue over the last 1, 5 and 15 minutes

eg.,
% uptime
2:47am up 11 day(s), 57 min(s), 1 user, load average: 0.14, 0.15, 0.17



Comments: Post a Comment

Links to this post:

Create a Link



<< Home


2004-2017 

This page is powered by Blogger. Isn't yours?