Few basic SmartOS commands

prctl, prstat, svcadm and svccfg
waldyrious/alt-syntax
Jon Gretar 2014-02-17 15:57:16 +00:00
parent 06ee4048bb
commit 97d4e48341
4 changed files with 77 additions and 0 deletions

16
sunos/prctl.md Normal file
View File

@ -0,0 +1,16 @@
# prctl
> Get or set the resource controls of running processes,
> tasks, and projects
- examine process limits and permissions
`prctl {{PID}}`
- examine process limits and permissions in machine parseable format
`prctl -P {{PID}}`
- Get specific limit for a running process
`prctl -n process.max-file-descriptor {{PID}}`

23
sunos/prstat.md Normal file
View File

@ -0,0 +1,23 @@
# prstat
> Report active process statistics
- examine all processes and reports statistics sorted by CPU usage
`prstat`
- examine all processes and reports statistics sorted by memory usage
`prstat -s rss`
- report total usage summary for each user
`prstat -t`
- report microstate process accounting information
`prstat -m`
- Print out a list of top 5 cpu using processes every second.
`prstat -c -n 5 -s cpu 1`

23
sunos/svcadm.md Normal file
View File

@ -0,0 +1,23 @@
# svcadm
> Manipulate service instances
- enable a service in the service database
`svcadm enable {{service_name}}`
- disable service
`svcadm disable {{service_name}}`
- restart a running service
`svcadm restart {{service_name}}`
- command service to re-read configuration files
`svcadm refresh {{service_name}}`
- clear a service from maintenance state and command it to start
`svcadm clear {{service_name}}`

15
sunos/svccfg.md Normal file
View File

@ -0,0 +1,15 @@
# svccfg
> Import, export, and modify service configurations
- validate configuration file
`svccfg validate {{smf.xml}}`
- export service configurations to file
`svccfg export {{servicename}} > {{smf.xml}}`
- import/update service configurations from file.
`svccfg import {{smf.xml}}`