Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Solaris 10 process Management

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Command

Description

Man Page

Ps 、 pgrep 、 prstat 、 pkill

Check the status of active processes on the system and display detailed information about those processes.

Ps (1), pgrep (1) and prstat (1m)

Pkill

The function is the same as pgrep, but by name or other attributes to find or signal the process, and then terminate the process. Send a signal to each matching process like the kill command without listing the process ID.

Pgrep (1) and pkill (1)

Kill (1)

Pargs 、 preap

Assist in process debugging.

Pargs (1) and preap (1)

Dispadmin

Lists the default process scheduling policies.

Dispadmin (1m)

Priocntl

Specify processes for priority classes and manage process priorities.

Priocntl (1)

Nice

Change the priority of the timesharing process.

Nice (1)

Psrset

Bind a specific process group to a set of processors instead of one processor.

Psrset (1m)

Use the ps command

Use the ps command to check the status of active processes on your system and to display technical information about processes. This data is useful for administrative tasks, such as determining how to set the priority of a process.

Field

Description

UID

Valid user ID for the process owner.

PID

Process ID.

PPID

Parent process ID.

C

Processor utilization for scheduling. This field is not displayed when the-c option is used.

CLS

The scheduling class to which the process belongs, such as real-time, system, or time-sharing. Only the-c option includes this field.

PRI

The scheduling priority of kernel threads. A higher number means a higher priority.

NI

The nice value of the process, which affects its scheduling priority. The higher the nice value of a process, the lower its priority.

ADDR

The address of the proc structure.

SZ

The virtual address size of the process.

WCHAN

The event at which the process sleeps or the address of the lock.

STIME

The process start time in hours, minutes, and seconds.

TTY

The terminal from which the process or its parent is started. The question mark indicates that there is no control terminal.

TIME

The total amount of CPU time used by the process since it started.

CMD

The command to generate the process.

List processes

You can use the ps command to list all processes in the system.

$ps [- efc]

Ps

Only the processes associated with your login session are displayed.

-ef

Displays all information about all processes that are being executed in the system.

-c

Displays process scheduler information.

$ps-ef

UID PID PPID C STIME TTY TIME CMD

Root 0 0 0 18:04:04? 0:15 sched

Root 5 0 0 18:04:03? 0:05 zpool-rpool

Root 1 00 18:04:05? 0:00 / sbin/init

Root 2 00 18:04:05? 0:00 pageout

Root 3 0 0 18:04:05? 2:52 fsflush

Root 6 0 0 18:04:05? 0:02 vmtasks

Daemon 739 1 0 19:03:58? 0:00 / usr/lib/nfs/nfs4cbd

Root 9 1 0 18:04:06? 0:14 / lib/svc/bin/svc.startd

Root 11 1 0 18:04:06? 0:45 / lib/svc/bin/svc.configd

Daemon 559 1 0 18:04:49? 0:00 / usr/sbin/rpcbind

Netcfg 47 1 0 18:04:19? 0:01 / lib/inet/netcfgd

Dladm 44 1 0 18:04:17? 0:00 / sbin/dlmgmtd

Netadm 51 1 0 18:04:22? 0:01 / lib/inet/ipmgmtd

Root 372 338 0 18:04:43? 0:00 / usr/lib/hal/hald-addon-cpufreq

Root 67 1 0 18:04:30? 0:02 / lib/inet/in.mpathd

Root 141 1 0 18:04:38? 0:00 / usr/lib/pfexecd

Netadm 89 1 0 18:04:31? 0:03 / lib/inet/nwamd

Root 602 1 0 18:04:50? 0:02 / usr/lib/inet/inetd start

Root 131 1 0 18:04:35? 0:01 / sbin/dhcpagent

Daemon 119 1 0 18:04:33? 0:00 / lib/crypto/kcfd

Root 333 10 18:04:41? 0:07 / usr/lib/hal/hald-- daemon=yes

Root 370 338 0 18:04:43? 0:00 / usr/lib/hal/hald-addon-network-discovery

Root 159 1 0 18:04:39? 0:00 / usr/lib/sysevent/syseventd

Root 236 1 0 18:04:40? 0:00 / usr/lib/ldoms/drd

Root 535 1 0 18:04:46? 0:09 / usr/sbin/nscd

Root 305 1 0 18:04:40? 0:00 / usr/lib/zones/zonestatd

Root 326 1 0 18:04:41? 0:03 / usr/lib/devfsadm/devfsadmd

Root 314 10 18:04:40? 0:00 / usr/lib/dbus-daemon-- system

View the process

Root@solaris10:/ # prstat

PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP

751 noaccess 181M 120m sleep 59 0 0:32:53 0.0% java/19

2513 root 3804K 2944K cpu0 59 00:00: 00 0.0% prstat/1

641 root 48m 15m sleep 59 0 0:03:29 0.0% Xorg/1

762 root 11m 7012K sleep 59 0 0:01:59 0.0% dtgreet/1

2465 root 6388K 3628K sleep 59 00:00: 00 0.0% sshd/1

685 root 3388K 1900K sleep 59 00:00: 00 0.0% devfsadm/6

582 root 2488K 1296K sleep 59 00:00: 00 0.0% snmpdx/1

594 root 3276K 1448K sleep 59 00:00: 00 0.0% dmispd/1

555 root 8380K 1724K sleep 59 00: 00:08 0.0% sendmail/1

2475 root 2932K 1776K sleep 59 00:00: 00 0.0% bash/1

560 root 9476K 5676K sleep 59 00: 00:02 0.0% snmpd/1

2471 root 1452K 892K sleep 59 00:00: 00 0.0% sh/1

636 root 5584K 1448K sleep 59 00:00: 00 0.0% dtlogin/1

638 root 2560K 792K sleep 59 00:00: 00 0.0% fbconsole/1

557 smmsp 8388K 1488K sleep 59 00:00: 00 0.0% sendmail/1

511 root 3880K 1248K sleep 59 00:00: 00 0.0% sshd/1

517 root 14m 10m sleep 59 00:00: 00 0.0% fmd/17

515 root 4004K 1732K sleep 59 00:00: 00 0.0% syslogd/14

494 root 2532K 98K sleep 59 00:00: 00 0.0% automountd/2

495 root 2820K 1560K sleep 59 00: 00:01 0.0% automountd/3

412 root 2072K 676K sleep 59 00:00: 00 0.0% smcboot/1

384 root 1440K 664K sleep 59 00:00: 00 0.0% utmpd/1

149 root 1800K 1028K sleep 59 00:00: 00 0.0% powerd/3

383 root 6268K 3240K sleep 59 00: 00:04 0.0% inetd/4

414 root 2072K 676K sleep 59 00:00: 00 0.0% smcboot/1

198 root 3700K 2412K sleep 59 00:00: 00 0.0% picld/4

395 root 2444K 1276K sleep 59 00:00: 00 0.0% ttymon/1

342 daemon 2428K 1360K sleep 60-20 0:00:00 0.0% lockd/2

337 daemon 2780K 1604K sleep 59 00:00: 00 0.0% statd/1

333 daemon 2448K 1304K sleep 60-20 0:00:00 0.0% nfs4cbd/2

263 root 2240K 748K sleep 59 00:00: 00 0.0% iscsid/2

109 daemon 4256K 2048K sleep 59 00:00: 00 0.0% kcfd/3

112 root 5028K 1948K sleep 59 00:00: 00 0.0% syseventd/15

375 root 2448K 1200K sleep 59 00:00: 00 0.0% ttymon/1

410 root 2072K 976K sleep 59 00:00: 00 0.0% smcboot/1

108 root 6372K 2852K sleep 59 00: 00:12 0.0% nscd/31

282 root 2768K 1000K sleep 59 00:00: 00 0.0% cron/1

545 root 3264K 2224K sleep 59 00:00: 00 0.0% vold/6

374 root 2080K 928K sleep 59 00:00: 00 0.0% sac/1

335 daemon 4696K 1148K sleep 59 00:00: 00 0.0% nfsmapid/3

9 root 9432K 7560K sleep 59 00: 00:12 0.0% svc.configd/16

Total: 47 processes, 197 lwps, load averages: 0.00, 0.00, 0.00

Display information about the process

# pgrep cron gets the process ID of the cron process

4780

# pwdx 4780 displays the current working directory of the cron process

4780: / var/spool/cron/atjobs

# ptree 4780 displays the process tree containing cron processes

4780 / usr/sbin/cron

# pfiles 4780 displays fstat and fcntl information

4780: / usr/sbin/cron

Current rlimit: 256 file descriptors

0: S_IFCHR mode:0666 dev:290,0 ino:6815752 uid:0 gid:3 rdev:13,2

O_RDONLY | O_LARGEFILE

/ devices/pseudo/mm@0:null

1: S_IFREG mode:0600 dev:32128 ino:42054 uid:0 gid:0 size:9771

O_WRONLY | O_APPEND | O_CREAT | O_LARGEFILE

/ var/cron/log

2: S_IFREG mode:0600 dev:32128 ino:42054 uid:0 gid:0 size:9771

O_WRONLY | O_APPEND | O_CREAT | O_LARGEFILE

/ var/cron/log

3: S_IFIFO mode:0600 dev:32128 ino:42049 uid:0 gid:0 size:0

O_RDWR | O_LARGEFILE

/ etc/cron.d/FIFO

4: S_IFIFO mode:0000 dev:293,0 ino:4630 uid:0 gid:0 size:0

O_RDWR | O_NONBLOCK

5: S_IFIFO mode:0000 dev:293,0 ino:4630 uid:0 gid:0 size:0

O_RDWR

Control process

Terminate the process

$pkill [signal] process

Signal

When the pkill command line syntax does not contain any signals, the default signal used is-15 (SIGKILL). Using the-9 signal (SIGTERM) with the pkill command ensures that the process terminates quickly. However, you should not use the-9 signal to abort a specific process, such as a database process or a LDAP server process. Doing so may lose data.

Process

Is the name of the process to stop.

# kill [signal-number] pid

Signal

When no signal is included in the kill command line syntax, the default signal used is-15 (SIGKILL). Using the-9 signal (SIGTERM) with the kill command ensures that the process terminates quickly. However, you should not use the-9 signal to abort a specific process, such as a database process or a LDAP server process. Doing so may lose data.

Pid

Is the process ID of the process to be terminated.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report