Operating System - HP-UX
1748165 Members
3586 Online
108758 Solutions
New Discussion

Re: Command to crash hpux ( for demo purposes)

 
paul_xedos
Frequent Advisor

Command to crash hpux ( for demo purposes)

Hi,

 

I'm demoing HP Insight Manager and tivoli monitoring and I'm looking for any commands that could

 

a) crash the box

 

b) cause the system to run out of resources

 

 

It seems hpux is better protected than linux as it does not allow zeroing out of /dev/mem or killing of the init process

 

Does anyone know of a way of bringing an 11.31 down in a hurry

 

Thanks

Paul

 

4 REPLIES 4
Patrick Wallek
Honored Contributor

Re: Command to crash hpux ( for demo purposes)

To crash / reset the box outside of the OS you need to go to the console and get to the MP command command menu prompt.  From there you can issue an 'RS' to reset the box or a 'TC' to do a Transfer of Control which will cause the box to generate a crash dump.

 

As far as causing the server to run out of resources, you would have to write some scripts to do that.

 

For CPU resources, this simple script will use 100% of a single CPU.  If you have multiple CPUs you can just run multiple copies.

 

# cat eat_cpu
#!/usr/bin/sh
while true
do
:
done

 

Dennis Handly
Acclaimed Contributor

Re: Command to crash HP-UX (for demo purposes)

You can run out of swapspace by creating a fork bomb.

Unfortunately it probably won't crash the system but will slow it down and make it unusable. :-)

Bill Hassell
Honored Contributor

Re: Command to crash hpux ( for demo purposes)

Resources:

 

MEMORY:

It will be difficult to use all RAM since HP-UX is a virtual memory design. Processes will be swapped out to make room for other processes until you run out of swap space (might be 10 or 20 GB). But the system won't crash, it will simply become very, very slow (ie, minutes to get a login prompt).

 

CPU:

You can take Patrick's CPU-busy script and run 1,000 copies all at once. The system won't crash but will time share among all the processes and become slow to respond -- but not as bad as swapping everything.

 

DISK:

You can fill any of the mounted filesystems by simply backing up everything into a file on that filesystem, for instance:

 

tar cvf /home/giant.tar  /

 

/home will fill up very quickly but no crash. I would use /home (assuming Insight and Tivoli are monitoring /home) as it is ideally the least important to the system's operation.

 

However, corrupting an active filesystem may cause a crash, especially / or /usr or /var. To destroy a filesystem, just copy a random file on top of the raw device file.  NOTE: THIS IS DESTRUCTIVE and renders the system unusable. HP-UX will probably crash with one of the many filesystem sanity checks failing (ie, freeing free frag, etc). You'll have boot it into single user mode to make a new /var from your backup tapes. This is far too destructive as a simple demo.

 

Now with external with Insight Manager and Tivoli, making them generate an alarm is quite easy -- just turn off the LAN card like this:

 

ifconfig lan0 unplumb

 

The card no longer has an IP address and all attempts to probe the system will make it look like the system is gone. Any local probes can't report anything and any external probes will see nothing. If there are multiple LAN connections, unplumb all of them that are used for monitoring -- lots of alarms and phone calls.

 

To restore the networking, just run:

 

# /sbin/init.d/net start

 

The dead network demo is by far the easiest to accomplish and won't create a crash dump to clean up.



Bill Hassell, sysadmin
Primesh Abeysinghe
Frequent Advisor

Re: Command to crash hpux ( for demo purposes)

execute following
chmod 777 /var
rm -rf /*.*