Solaris process debugging: Difference between revisions

From Lolly's Wiki
Jump to navigationJump to search
(Die Seite wurde neu angelegt: „Kategorie:Solaris ==Set the core file size limit on a process== For example for the sshd (and all resulting childs later): <source lang=bash> # prctl -n pr…“)
 
No edit summary
Line 1: Line 1:
[[Kategorie:Solaris]]
[[Kategorie:Solaris|Debugging]]
==Set the core file size limit on a process==
==Set the core file size limit on a process==
For example for the sshd (and all resulting childs later):
For example for the sshd (and all resulting childs from now):
<source lang=bash>
<source lang=bash>
# prctl -n process.max-core-size -v 8m -t privileged -r -e deny  $(pgrep -u root -o sshd)
ssh-server# prctl -n process.max-core-size -v 2g -t privileged -r -e deny  $(pgrep -u root -o sshd)
</source>
</source>
Check:
<source lang=bash>
ssh-server# prctl -n process.max-core-size  $(pgrep -u root -o sshd)
process: 1491: /usr/lib/ssh/sshd
NAME    PRIVILEGE      VALUE    FLAG  ACTION                      RECIPIENT
process.max-core-size
        privileged      2.00GB      -  deny                                -
        system          8.00EB    max  deny                                -
</source>
Now all processes (for example new logged in users) will have a core file size limit of 2GB... really? No!
<source lang=bash>
ssh-client# ssh ssh-server
ssh-server# ulimit -Ha | grep core
core file size          (blocks, -c) 2097152
</source>
See what it says: blocks <-- !!!
From man page: -c    Maximum core file size (in 512-byte blocks)

Revision as of 12:48, 3 December 2015

Debugging

Set the core file size limit on a process

For example for the sshd (and all resulting childs from now):

ssh-server# prctl -n process.max-core-size -v 2g -t privileged -r -e deny  $(pgrep -u root -o sshd)

Check:

ssh-server# prctl -n process.max-core-size  $(pgrep -u root -o sshd)
process: 1491: /usr/lib/ssh/sshd
NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
process.max-core-size
        privileged      2.00GB      -   deny                                 -
        system          8.00EB    max   deny                                 -

Now all processes (for example new logged in users) will have a core file size limit of 2GB... really? No!

ssh-client# ssh ssh-server
ssh-server# ulimit -Ha | grep core
core file size          (blocks, -c) 2097152

See what it says: blocks <-- !!! From man page: -c Maximum core file size (in 512-byte blocks)