Sponsored Content
Top Forums Shell Programming and Scripting Code that has to end no matter what Post 303022476 by drew77 on Saturday 1st of September 2018 12:23:36 PM
Old 09-01-2018
Do NOT run this unless you are prepared to reboot. :-(

When I ran the code below....

test.sh 5
Max runtime exceeded, killing PID 2749
/home/andy/bin/test.sh: line 30: 2749 Killed $command > /dev/null 2> /dev/null
Killed.


Code:
command="/usr/bin/stress --cpu 8 --io 4 --vm 2 --vm-bytes 128M"

maxruntime=$1

$command >/dev/null 2>/dev/null &
watchpid=$!

/bin/sleep "$maxruntime"

if [ -d "/proc/$watchpid" ]
then
        echo "Max runtime exceeded, killing PID $watchpid"

        if /bin/kill -9 "$watchpid" >/dev/null 2>/dev/null
        then
                echo "Killed."
                exit 0
        else
                echo "Could not kill, please investigate manually."
                exit 1
        fi
fi

If you are gonna slice haberno peppers, either use gloves or wash hands 3 times. I forgot and rubbed my eyes.

Last edited by drew77; 09-01-2018 at 02:27 PM..
 

5 More Discussions You Might Find Interesting

1. Linux

Need help with this matter

I have a PC that was built in Europe pre-installed with Windows 2000. The HDD is 40GB, but, its split up as two 20GB (Taken up by Windows). I want to take over my Mandrake 9.1 CDs and install Linux on that machine. My question is, how would I proceed to install Linux this way??? Now, If... (1 Reply)
Discussion started by: wardialer
1 Replies

2. Shell Programming and Scripting

How to delete matter in between two lines

help I am having text file like this... ------------------------END OF UPDATION ------------------ xxxxxxxxxxxxxxxxxxxxxxxxx yyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyy 1 row updated ------------------------END OF UPDATION ------------------ TTTTTTTTTTTTTTTT FFFFFFFFFFFFFFFFF ... (3 Replies)
Discussion started by: suryanarayana
3 Replies

3. Shell Programming and Scripting

Terminal to the front no matter what

Is there a way to bring the terminal script to the front? I am running this script through OMCEdit which is then running it through Terminal. I have some dialog boxes (using osascript) and the dialog boxes are not coming to the front...Terminal bounces and I have to click on Terminal to see the... (1 Reply)
Discussion started by: mainegate
1 Replies

4. Shell Programming and Scripting

grep matter between braces

#include<header.h> void classname :: pvvd_init ( abcd ,efgh ,ijkl ,mnop ) { rvcl_tabl_name_tabl.pvvd_init ( xxxx ,"tabl_mame" ) ; ... (2 Replies)
Discussion started by: ultimatix
2 Replies

5. UNIX for Dummies Questions & Answers

Strange system activity no matter what I try

When I choose to encrypt my drive during a Linux install, it encryps it, but I receive errors in dmesg and in ~/.xsessions-errors during use. The first error is in dmesg where it sometimes shows errors writing to the encypted device. The second error is in ~/.xsessions-errors with an error about... (0 Replies)
Discussion started by: justgoogleit
0 Replies
pxfw(8) 							     pxfw 0.5								   pxfw(8)

NAME
pxfw - Firmware flashing tool for Plextor CD/DVD devices SYNOPSIS
pxfw -l pxfw -d DEVICE [-if firmware.bin] [-u] [-f] [-v] pxfw -d DEVICE [-e] [-r] [-t] [-v] DESCRIPTION
pxfw is the linux firmware flasher for Plextor CD and DVD drives. Remove any disks before flashing. FEATURES
You can flash the firmware of these drives: Plextor Premium, Premium-2, PX-712, PX-716, PX-755 and PX-760. DEVICE
can be an IDE, SCSI, SATA, USB or FireWire connected optical drive. Not all SATA controller support all Plextor features. Linux: /dev/hdX: IDE device /dev/scdX: Linux 2.4: SATA, SCSI, USB device, or IDE device via ide-scsi emulation /dev/srX: Linux 2.6: IDE device via new ATA layer, SCSI or USB device OpenBSD/NetBSD: /dev/rcdX FreeBSD: /dev/cd: SCSI device /dev/acd: ATA device MacOS X: /dev/disk: win32: C:,D:,E:, ... X:,Y:,Z: OPTIONS
-l scan busses for all available CD and DVD devices -if select inputfile. Specify the firmware binary file, which should be written to DEVICE. -u proceed update. When the firmware checksum test has succeeded, write firmware to DEVICE. -f force flashing. Even if DEVICE is not recognized, or firmware. checksum has failed, firmware writing will be forced. Handle with care. -e read EEPROM from DEVICE. -r reboot the device. -t test which opcodes are supported by the device. -v debug. EXAMPLES
pxfw -d /dev/hdc -if 755_1.07.bin -u writes firmware file 755_1.07.bin into Master Drive on Secondary IDE-Port. pxfw -d /dev/sr3 -e -oe file.foo reades EEPROM from device /dev/sr3 and writes it to file.foo. please report man page improvements to T.Maguin@web.de Gennady ShultZ Kozlov 02 April, 2009 pxfw(8)
All times are GMT -4. The time now is 10:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy