No subject


Sun Feb 10 21:45:11 GMT 2008


every 60 seconds, check the configuration database for changes and execute
jobs as needed.   Job execution would consist of checking the jobs
credentials ( if run as X, fork, lock records to job handler PID, descend
privileges to specified user, chdir to script path, wrap the job in a
subprocess, respond to job events as needed ( stderr, ! zero return,
excessive run time, etc ).

    My question is, anyone see a better way, or a OSS project out there that
could do the above for me... even a beta project written in python or c++
could be workable by me.  If you haven't noticed the varying levels of
sarcasm, I'm somewhat stretched thin right now.

    Thanks,
            David


------=_NextPart_000_0098_01C883A6.ABBBF1D0
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:st1=3D"urn:schemas-microsoft-com:office:smarttags" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags" =
name=3D"City"/>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
 name=3D"place"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-reply;
	font-family:Arial;
	color:navy;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>You could probably jerry-rig Nagios =
to do
this for you.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Create a &#8216;check&#8217; (in =
perl?)
which runs your &#8216;program&#8217; and you can use Nagios&#8217;s =
built-in
pager/up-time/historical recording for your =
needs.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Just an =
idea,<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>- =
Mitch<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=3DMsoNormal align=3Dcenter style=3D'text-align:center'><font =
size=3D3
face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>

<hr size=3D2 width=3D"100%" align=3Dcenter tabindex=3D-1>

</span></font></div>

<p class=3DMsoNormal><b><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font =
size=3D2
face=3DTahoma><span style=3D'font-size:10.0pt;font-family:Tahoma'>
ubuntu-us-co-bounces at lists.ubuntu.com
[mailto:ubuntu-us-co-bounces at lists.ubuntu.com] <b><span =
style=3D'font-weight:
bold'>On Behalf Of </span></b>David J W<br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> Sunday, March 09, =
2008 5:12
PM<br>
<b><span style=3D'font-weight:bold'>To:</span></b> =
ubuntu-us-co at lists.ubuntu.com<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> [CoLoCo] =
Job/batch
management</span></font><o:p></o:p></p>

</div>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>Hello,<br>
&nbsp;&nbsp;&nbsp; First off an introduction as this is my first =
post:<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I work in <st1:City =
w:st=3D"on"><st1:place w:st=3D"on">Denver</st1:place></st1:City>
as a multi-hat developer: php/python/bash/c++ developer, linux system =
admin,
and a intermediate MySQL database administrator, and also my current =
company's
R&amp;D developer.&nbsp; I've been working with *nix since 1996-97 when =
a c++
programming course I took was taught exclusively on v220 terminals =
connected to
a mini-computer.&nbsp;&nbsp; <br>
<br>
I'm on week 2 or maybe 3 of doing research for consolidating my =
company's small
and growing horde of cronjobs... its well over 150 script at this =
point.&nbsp;
The company CEO has directed me to start research and research I have =
done.<br>
<br>
Why crontab sucks for what I need:<br>
<br>
&nbsp; Cron does a fantastic job at what it does, run something at X =
time.<br>
&nbsp; The problem is, what if I need alt_X to run if X exists =
non-zero....
alright so I could do:<br>
&nbsp;&nbsp;&nbsp; x || alt_x<br>
<br>
&nbsp;&nbsp; Now what if I need y to run after x if its successfull<br>
<br>
&nbsp;&nbsp; (x &amp;&amp; y ) || alt_x<br>
<br>
&nbsp;&nbsp; Well thats not right?&nbsp; x could perform correctly then =
have y
fail, causing alt_x to run and possibly redo important =
operations/data.<br>
<br>
&nbsp;&nbsp; (x || alt_x) &amp;&amp; y&nbsp; - except what if I don't =
want y to
run if alt_x ends up running?<br>
&nbsp;<br>
<br>
&nbsp;&nbsp; Now to make things fun.... lets say there is a chain of 4-5
scripts that must run conditionally.&nbsp; I'm pretty decent with simple =
and/or
logic, but I know this would confuse anyone else to read and =
decypher.&nbsp;
Making it so only I and maybe one or two disciples can maintain the =
abomination
that is the company's backend underworld.<br>
<br>
Plan B (partially in effect)<br>
&nbsp;&nbsp; Complex jobs are written as bash scripts.&nbsp; This is a =
step up
from the above, I can build a job with variables, capture output to temp =
files,
and use mail or sendmail to make customized emails.&nbsp; Whats lacking =
is
resuability.&nbsp; Sure I can write shell script libraries to reuse =
certain
things, like a bash wrapper function to handle individual scripts.... =
but
adding in context sensitive checks &quot;has the word failure, critical, =
OMFG,
etc&quot; would be hard coded in.<br>
<br>
Plan C ( what I am aiming for)<br>
&nbsp;&nbsp; So I'm looking for a cronjob equivalent scheduling system =
that can
be configured by information stored in a database (MySQL, sqllite,
whatever).&nbsp; This phantom program would have the following =
specs:<br>
<br>
&nbsp;&nbsp;&nbsp; Run any process/job as either root or a specific user
account<br>
&nbsp;&nbsp;&nbsp; Record the job fitness ( maximum memory, time stats =
(rtime,
utime, overall)<br>
&nbsp;&nbsp;&nbsp; Historical recording ( save input to DB or serialized =
filestore
)<br>
&nbsp;&nbsp;&nbsp; Context sensitive output handling<br>
&nbsp;&nbsp;&nbsp; Digest email capability ( instead of 120-140 emails a =
day,
I'd be estatic with like 30)<br>
&nbsp;&nbsp;&nbsp; SMP/pager capability<br>
<br>
&nbsp;&nbsp; I've started prototyping the above in python, but I figure =
to get
this to a stable enough product, it would take me 3-4 days of =
development time
then a residual 5-15 hours for the next month or two in responsive
debugging.&nbsp; From my prototypes, I'd have a daemonized python script =
that
would sleep every 60 seconds, check the configuration database for =
changes and
execute jobs as needed.&nbsp;&nbsp; Job execution would consist of =
checking the
jobs credentials ( if run as X, fork, lock records to job handler PID, =
descend
privileges to specified user, chdir to script path, wrap the job in a =
subprocess,
respond to job events as needed ( stderr, ! zero return, excessive run =
time,
etc ).<br>
<br>
&nbsp;&nbsp;&nbsp; My question is, anyone see a better way, or a =
<st1:City
w:st=3D"on"><st1:place w:st=3D"on">OSS</st1:place></st1:City> project =
out there
that could do the above for me... even a beta project written in python =
or c++
could be workable by me.&nbsp; If you haven't noticed the varying levels =
of
sarcasm, I'm somewhat stretched thin right now.<br>
<br>
&nbsp;&nbsp;&nbsp; Thanks,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
David<o:p></o:p></span></font></p>

</div>

</body>

</html>

------=_NextPart_000_0098_01C883A6.ABBBF1D0--





More information about the Ubuntu-us-co mailing list