Working on that... it looks simple, but the code isn't giving me what I expected...<br>/me grumbles looking at unknown APIs...<br><br clear="all">Marc-André LAVERDIÈRE<br>"Perseverance must finish its work so that you may be mature and complete, <br>
not lacking anything." -James 1:4<br><a href="http://asimplediscipleslife.blogspot.com/">http://asimplediscipleslife.blogspot.com/</a><br><a href="http://mlaverd.theunixplace.com">mlaverd.theunixplace.com</a><br><br>
<br>
<br><br><div class="gmail_quote">On Mon, Nov 21, 2011 at 7:15 AM, Lionel Elie Mamane <span dir="ltr"><<a href="mailto:lionel@mamane.lu">lionel@mamane.lu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Mon, Nov 21, 2011 at 11:50:52AM +0000, Michael Meeks wrote:<br>
> On Sat, 2011-11-19 at 16:15 -0500, Marc-André Laverdière wrote:<br>
<br>
>> I am convincing some powers-that-be that having a build farm would<br>
>> be good, and they are starting to listen. This would really help me<br>
>> write patches for LO, as my poor computer is having impossibly long<br>
>> compile cycles.<br>
<br>
</div><div class="im">>> There is a bunch of somewhat old Linux workstations that could<br>
>> contribute to it. The concern is mostly that it should be so that the<br>
>> systems should not accept jobs when users are logged in, as it may<br>
>> interfere with whatever work it is that they are doing.<br>
<br>
</div>Maybe more interesting than "nobody logged on" would be "system load<br>
very low", e.g. "load <= 0.1*(number of cores)", possibly combined<br>
with "free memory + memory used for cache >= threshold".<br>
<div class="im"><br>
> I'm sure they'd accept a patch to add a config option to use some<br>
> system heuristic before accepting a job. Of course, reliably detecting a<br>
> login session is prolly quite fun in itself ;-) ps ax | grep<br>
> gnome-session | kdeinit or something ?<br>
<br>
</div>Nah:<br>
<br>
#include <utmpx.h><br>
<br>
struct utmpx *getutxent(void);<br>
struct utmpx *getutxid(const struct utmpx *);<br>
struct utmpx *getutxline(const struct utmpx *);<br>
struct utmpx *pututxline(const struct utmpx *);<br>
void setutxent(void);<br>
void endutxent(void);<br>
<br>
is the POSIX/SUS interface to do that. Or just run "/usr/bin/who -q"<br>
:)<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Lionel<br>
</font></span></blockquote></div><br>