General :: Process - Run A Script For A Specified Amount Of Time Before Stopping And Restarting
Jul 15, 2010
Possibly related to this previous question, I would like to be able to run a task for a specified amount of time, then stop/kill it, then start it again. Specifically, I run the Folding@Home application on my Linux workstation. Periodically, it will have trouble logging-in to the home server, and will sit idle for a long time, but not release memory/resources it has claimed (yes, I realize this is likely a bug in the tool, but I can't fix that currently). Typically just the act of killing and starting the tool will allow it to check-in again. So, I would like to be able to run something like:
run_for <time> ./fah6
Does such a tool exist, or should I write a wrapper than nukes the fah6 client after, say, a week and restart it?
I am having a problem in that the Web Server (Apache) keeps stopping. I know this as watchdog is emailing me. Then about 15mins later it starts again. I cannot seem to find why. can anyone give me pointers as where to look to find the issue.
whats the difference between restarting/stopping apache using 'service httpd restart/stop' and apachectl restart/stop. I know that using 'service httpd restart' is actually a script in /etc/init.d/httpd but what about apachectl?
I want to record an internet radio station starting at 2:00am tomorrow morning. The specific program on the radio station lasts until 6:00am. The command I need to run to record the station is: Code:mplayer http://wjcu.jcu.edu:8001/listen.pls -ao pcm:file=indie_heat_of_the_night.wav -vc dummy -vo nullI'd use cron, but 1. I'm not sure how to and 2. it seems unnecessarily complicated for something that I only want to run once. If cron is the only/easiest solution, I guess I'll just have to resort to that, but I'd rather not.
get the values for the user time and system time for a process.i have tried getrusage to get values of ru_utime and ru_stimebut these don't seem to be correct
I am using Fedora12 with latest update, and am using kde4.3.4.
To decrease the memory consumption on one of my system I disabled many services presently only following services are running:
NetworkManager abrtd acpid akmods
[Code]....
Now I want to stop some default running process like modem-manager, seapplet, ksmserver, krunner and sometime knotify4. I could not locate the initiation point of these services. So that I can manage (start/stop) these services.
I am working in Linux and have connected a normal LED to my serial port (with voltage conversion). I am just trying to make that LED blink periodically using alarm ().So in the signal handling routine of my code,i toggle the LED but then the program quits as SIGALRM terminates the process. Shall i make a nested alarm so that the handling routine also has an alram()? I am stuck and i must confess that i am not so convenient with signal handling so can someone provide some pointers?I thought about using sleep(); but the advantage with alarm is that it waits for the exact number of seconds (when the second turn over from previous to new value) before raising the alarm while i am not sure about sleep taht does that or not.
I just installed the newest version of ubuntu on my Alienware desktop. It installed fine and I was running everything perfectly. Then I restarted the computer, just to test that out, and now it won't let me get back in.
It takes me to a screen which asks me to select the OS. I select "Ubuntu with Linux 2.6.35-23-generic-pae", but then it goes to a black screen with the blinking cursor, and nothing happens (even after waiting >10 minutes)
I'm booting off of the internal hard drive, since that is where I installed Ubuntu initially.
Most nights I fall asleep watching tv or movies. I want the computer to go to sleep after I do. Under Power Management Properties I have "put computer to sleep when inactive for 1:00" yes - to " spin down hard disks" and "put display to sleep when inactive for 1:00"
I'd say 65% of the time I wake up and the computer is running, not suspended, and 45% of the time the monitor is still on. Over the past 8 months or so I have been trying different media players. I tend to have the same problem of the computer not sleeping with all of them. (Banshee, Miro, xbmc, boxee, vlc, totem, )
1. Is there a process I can look for that may be running some of the time that would hinder the suspend function?
2. Is there a simple script I can write for "suspend in 90 minutes"
3. I think I remember seeing way to do this from the CLI with pm-suspend, yeah?
Edit- I found this http://bit.ly/hpThVM Things I tested that didn't work ~$ sudo echo pm-suspend | at 12:27 ~$ sudo sleep 30s
i have a program for x64 and i need to complile it for x32 bits if somebody knows i will be happy to know!
Here it is:
/* * timeout - run a command for a limited amount of time * * Uses POSIX process groups so that we do the right thing when the controlled * command forks off child processes. * * Author: Wietse Venema.
When I search addons with firefox, it takes 4 mins to connect to server, and after approving to ad it, it again takes that much time to connect to download. While downloading it's ok, but connecting to server takes time. This is for all addons. Is there any body having same issue?
I started to use linux (CentOS 5) 1 week ago. And I took lot of imformation from this forum. Is it possible to install two program at same time? Total download size: 67 M Is this ok [y/N]: y Downloading Packages: jdk-6u24-linux-i586.rpm 19% [========-] 6.0 kB/s | 13 MB 153:51 ETA It is so boring to wait and I have to wait there is nothing to do something else just centOs text.
I have a CentOS5 server with a 1tb hard drive.There is only 80gb of data on that huge drive and now I want to make a bare metal recovery backup using AcronisMy question is, how can I estimate the amount of time the backup will take and the size of the image file? Is it based on the size of my drive or is it based on the amount of data on the drive?
I want to limit the time a grep process command is allowed to run or be alive.For example. I want to perform the following:grep -qsRw -m1 "parameter" /varBut before running the grep command I want to limit how long the grep process is to live, say no longer than 30 seconds.How do I do this?And if it can, how do I return or reset to have no time limit afterwards.
It's pid is increasing all the time... I'm writing a program to display all the process's info, this process really bother me. Oh..the Chinese words are sleeping..., can't use, can't use
Centos 5.4 64bitWould like to know when a particular process was started.1.Quote:ll -d /proc/4014/dr-xr-xr-x 5 mysql mysql 0 Nov 28 07:34 /proc/4014/2.Quote:ps -o pid,lstart -p 4014 PIDSTARTED 4014 Tue Nov 17 23:10:13 20091) Which one should I consider?2) why do both have such a difference?
I'm rather new to linux, and I have a dedi server. I know how to browse, install, remove etc, all the basics needed to use it. I've installed flvtool2, memcoder and ffmpeg, and at the moment im converting avi files in to flv. Im then passing metadata using yamdi.
However, this process is very timely as im converting loads of avi files at a time.Im looking for a script, or a way where I can execute one command/script and which will convert all files in the directory I specify, then run those converted files through yamdi.Im guessing it would be some sort of loop, and then changing for each file?
I am currently struggling with one of my tasks.I was asked to find a way how to determine how much time an _already running_ process is spending in user and kernel space.E.G. <some tool> <pid>[Control] + [c]<pid> spent 12.1 seconds in user and 1.52 seconds in kernel space.Does something like this exist? Basically I guess I am looking for something similar to time, except that the process is already running.So..a) Is there a tool which fulfills this task?b) Is there a way to write your own software which does the job? Is it even possible to code something I am looking for?I recently found strace -c -p <pid>, but well, this is not exactly what I was looking for.
Boot of a new minimal system hangs on "Stopping save kernel messages" or "stopping system v runlevel compatibility". I have ubuntu minimal iso x86_64 from usb stick created with unetbootin (don't have a cd drive on the machine in question), and after that I didsudo aptitude install gnome-terminal network-manager-gnome gdm geditsudo rebootnever got a system back. Annoyingly I can't boot into the recovery mode either, and it seems the keyboard is only semi-responsive (i.e. many dead keys when at the grub menu).qualms about reinstalling, but I've done this a few times and ended up at the same place every time.
In December I finally filled up my root partition and broke Suse 11.1. I therefore resized my partitions and installed Suse 11.3 on /root. I didn't not touch my /home partition.
I notice that when I leave my machine and come back the screen has locked. I have tried to turn off the screensaver, but it hasn't worked. I have Googled, but unfortunately the screen shots don't look like what I have and the instructions to stop this do not seem to match what I am seeing on the screen.
I need a process A to be able to get the start time of process B. I have the PID of the process B.
I would have thought there would be a simple system call to make by passing in the pid of Process B, but I don't thing there is??!!
So my other thought is to create a script that will be passed the pid and either I can read the file creation of /proc/<PID>/stat or I could also parse the start time of ps on the <PID>. This script can be ran from the C++ code. My difficulty is capturing this information in the C++ code. If I run exec ( or system if not a script) I need the results in a program variable....not stdout.
My only solution is write it to a tmp file and read it back into the program variable. Seems rather arguious but a least it would work.
Background - I need to port Windows code ( GetProcessTimes(creationtime,...))
I'm trying to stop all the services on port 80 by I'm not entirely sure how.Infact, I don't really know what's running on port 80... I tried throwing a netstat -a in a prompt but I don't see port numbers anywhere so I can't figure out which PID to kill.Any ideas on how I can figure out what's running on port 80, and stop it?
I want to launch a gnome-terminal with a korn shell, and I want to specify in advance a command to execute, and then hand control back over to ksh. ex.
Code:
gnome-terminal --execute ksh -ic ls
I expect that to run ksh, do an 'ls' for example, and then give a prompt. I thought the -i switch (for interactive) meant that the shell would resume control, but this doesn't happen. The window just closes quicker than I can see what was output.
Client is running Oracle VM Server 2.2.1 (kernel 2.6.18-128.2.1.4.37.el5xen). Storage is a NetApp 3210 (NFS configured to use TCP). Iptables on client has udp and tcp ports 111, 2049 and the NFS server ports opened. Info retrieved using: rpcinfo -p NetApp When trying a manual mount.
[Code]....
stopping iptables also works (I can manually mount the share without using proto=tcp). Is the mounting process somehow trying to negotiate first using udp which the Netapp doesn't respond and hence it fails by timing out? Can I configure iptables such that I don't have to use the proto=tcp option? Or is there another configuration file I can tweak so that I don't have to use the proto=tcp option?
I have report running through a Unix server. In this it takes out certain data of the database and sends it to each of the user's mailbox. But if some user replies or has set his out of office reply then this server keeps on sending h the same mail again and again. I need stop it.