supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* timeout chpst -L
@ 2006-02-13 16:30 Alex Efros
  2006-02-13 20:18 ` Alex Efros
  0 siblings, 1 reply; 12+ messages in thread
From: Alex Efros @ 2006-02-13 16:30 UTC (permalink / raw)


Hi!

Is there exists some standard utility to run other process with timeout?
ulimit isn't suitable because it can only limit used CPU time, while I'm
speaking about real time.

My goal is run `chpst -L` but don't allow it to hang forever.

Of course there simple custom solution:
    chpst -L lock-file \
	perl -e 'alarm(shift);exec(@ARGV)' $timeout \
	$prog_to_execute
but I suppose there already exists such simple utility and also running perl
just to set alarm sounds little overkill.

Background:
    I've a couple of scripts which run by fluxbox when I press Alt-Fx or
    menu/winkey to switch between virtual desktops like it work in console.
    These scripts:
    - switch virtual desktop
    - store ID of previous virtual desktop into file (this allow me
      to switch between last two virtual desktops by pressing a menu key)
    - show ID of current virtual desktop using OSD
    The problem is what I sometimes switch too faster, these scripts execute
    in parallel, switching to different virtual desktops, and file with ID
    of previous desktop become corrupt (contain ID of current desktop instead).
    To fix this I wanna run my script using `chpst -L`, but I don't wanna
    fall into situation when I will not be able to switch virtual desktops
    because my script will hang (never happens before, but everything happens
    sometimes, especially bugs :)) and no new scripts will run because they
    will wait for lock forever.

-- 
			WBR, Alex.


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2006-02-14 12:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-13 16:30 timeout chpst -L Alex Efros
2006-02-13 20:18 ` Alex Efros
2006-02-14  8:45   ` Gerrit Pape
2006-02-14 10:23     ` Alex Efros
2006-02-14 10:36       ` Gerrit Pape
2006-02-14 11:01         ` Alex Efros
2006-02-14 11:21           ` Gerrit Pape
2006-02-14 11:30             ` Alex Efros
2006-02-14 11:36               ` Gerrit Pape
2006-02-14 11:54                 ` Alex Efros
2006-02-14 12:39                   ` Gerrit Pape
2006-02-14 12:53                     ` Alex Efros

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).