bzfscron 0.1

Questions, comments, and news on the server side plug-ins and it's API
User avatar
SilverFox
Private First Class
Private First Class
Posts: 163
Joined: Wed Oct 06, 2004 6:51 pm
Contact:

Post by SilverFox » Sat Dec 31, 2005 7:43 am

The reason I tried those things is because there was a problem in the current CVS (I posted the fix in this thread)

We used bzfscron for a couple days with mild success. This is an excellent idea, and I look forward to it continuing. We had a couple of unusual problems, and because of that, have pulled it from silvercat and are using a unixcron job to accomplish the same task.

One of the problems is that running bzfscron (from the startup as I died suggested) along with four -d's causes it to "freeze" bzfs. No error message, the process keeps running, the tcp/udp port is open and listening, but connects timeout.

Another is we've had this same symptom after 2 days w/out trouble inexplicably start again w/out the verbose detail. Since there is no error, its quite difficult to troubleshoot. Its possible that a minor change in the crontab caused this. If that's the case, I'd say the error handling needed to be worked on a bit (more sanity checks).

Lastly, it seems that the bzfscron plugin causes bzfs to quit with a non-zero exit value. This goofed with our rotation scripts which do a little error handling. At the end of the day, we can do the same thing with bzadmin and unixcron. I look forward to this plugin maturing. It'd be much more valueable if it was able to "include" cron tasks files on the fly.

User avatar
DTRemenak
General
General
Posts: 625
Joined: Thu Jan 16, 2003 4:54 am
Location: U.S.
Contact:

Post by DTRemenak » Mon Jan 02, 2006 11:01 pm

There are certainly problems with this plugin. It's kind of a bad hack to begin with. It will only load in player slot 0, as I_Died_Once discovered. It doesn't have to be loaded first, but slot 0 needs to be unoccupied, and loading it at startup is the easiest way to guarantee that. (If you have Player A and Player B join in order, then Player A quits, Player B can load bzfscron successfully in slot 0). I haven't looked at why.

I've never seen the timeout problem. Could be some crazy conflict. Basically the way bzfscron works, it connects to bzfs over tcp. If you read that again, you'll note that bzfscron is the same thread as bzfs itself, so it's like bzfs is establishing a socket to itself in order to do stuff. It's very ugly; I was amazed it worked at all.

I haven't noticed the nonzero exit value. I can look at that sometime.

What do you mean by "include cron task files on the fly"? There should be a way to reload the crontab after editing it, but it's been so long since I wrote it I'm not sure :)

If people are interested in using bzfscron I can take a look at solving some of the problems. I stopped working on it because I_Died_Once was the only person using it, and he seemed to have worked out how to avoid the problems.

User avatar
The Knights Who Say Ni
Private First Class
Private First Class
Posts: 556
Joined: Mon Sep 26, 2005 7:21 pm
Location: Uplyme, England
Contact:

Post by The Knights Who Say Ni » Mon Jan 02, 2006 11:29 pm

i used it but it didnt seem to work right so if you could fix it up then i would use it again...
Image
Sig Made By AlliedArmour

TGPH

User avatar
SilverFox
Private First Class
Private First Class
Posts: 163
Joined: Wed Oct 06, 2004 6:51 pm
Contact:

bzfscron includes

Post by SilverFox » Tue Jan 03, 2006 5:51 pm

DTRemenak wrote:What do you mean by "include cron task files on the fly"? There should be a way to reload the crontab after editing it, but it's been so long since I wrote it I'm not sure
What I mean is there should be an operator that allows you to "include" a file which contains a list of commands to execute.
For example:

Code: Select all

0 0 * * * @/var/bzflag/bzmidnightcron
This would run at midnight, and load the commands in /var/bzflag/bzmidnightcron each and every midnight (that way if I make a change in this file, it'll take effect w/out reloading bzfscron or bzfs)

This would also allow a script which looks at outside (the game) criteria to decide on how to write the file. ie. a script which writes to this file:

Code: Select all

echo "/say Hey, it just became `date +%A`" > /var/bzflag/bzmidnightcron
This is just a rudimentary example, but it should give you an idea of its potential. Its probably more important to figure out the little glitches that should be iron'd out.
Last edited by SilverFox on Tue Jan 03, 2006 7:30 pm, edited 1 time in total.

User avatar
The Knights Who Say Ni
Private First Class
Private First Class
Posts: 556
Joined: Mon Sep 26, 2005 7:21 pm
Location: Uplyme, England
Contact:

Post by The Knights Who Say Ni » Tue Jan 03, 2006 5:54 pm

there is its called the crontab
Image
Sig Made By AlliedArmour

TGPH

User avatar
SilverFox
Private First Class
Private First Class
Posts: 163
Joined: Wed Oct 06, 2004 6:51 pm
Contact:

Post by SilverFox » Tue Jan 03, 2006 7:37 pm

The Knights Who Say Ni wrote:there is its called the crontab
You completely missed the point.

In the bzfs crontab, I'd put:

Code: Select all

0 0 * * * @/var/bzflag/bzmidnightcron
each time it was midnight, bzfscron would read this file (due to the @ operator) and execute the commands that are in it. In addition to making the bzfscron file look nice and compartmentalized (ie, have birthdays all in a single file), you'd also be able to make changes to the files since the file contents wouldn't be loaded into bzfscron at load up, but actually read from the file on the fly.

And, if you disagree, you should explain why or try a question or two rather than a terse response.


-SilverFox

User avatar
I_Died_Once
Special Forces
Special Forces
Posts: 635
Joined: Sun Nov 28, 2004 5:27 pm
Location: The Dark Side
Contact:

Post by I_Died_Once » Tue Jan 03, 2006 7:42 pm

Yeah, this plugin is the bomb. I love it, and it is a nice contribution to the game. It does have its moments though.

For the longest time though, this one didn't work. It would carry out the first "task" on the first line of the crontab, but it wouldn't correctly read the rest of the file. I figured out how to update the header information, then it worked after a recompile, as the API the plugin was written on was updated, and a command or two in the sources needed to be changed because of it. Then the plugin quit working completely....

...and everytime, I was told the problem was me. The source is perfect, I was doing something wrong. Now, looking back through this, alot of the posts have been deleted. But in a sordid way, I'm glad to know that it wasn't "just me" having trouble with this plugin. Not that I am happy someone IS having trouble, I meant that in a vindication type of manner.
...This has been a recording.

User avatar
DTRemenak
General
General
Posts: 625
Joined: Thu Jan 16, 2003 4:54 am
Location: U.S.
Contact:

Post by DTRemenak » Wed Jan 04, 2006 12:17 am

Silverfox: You can run bzfscron commands in the crontab. So do something like:

Code: Select all

0 0 * * * /cron reload
and at midnight it will reload the crontab and update from any changes you've made.

I was gonna say somethin' about not reading the readme, but looking at the readme, I didn't put the /cron commands in it to begin with. Shame on me :) . "/cron reload" and "/cron list" are the two; reload reloads the crontab, list lists the jobs that are currently loaded.

Knights: I need more information than just "it didn't work". What did you do to set it up, what did you expect it to do, and what did it actually do?

I_Died_Once: No posts have been deleted AFAIK. Your problems were in another thread, possibly in another forum. And I can tell you for sure that the source is not perfect :).

I'll see what I can do about squashing some of the remaining bugs.

User avatar
SilverFox
Private First Class
Private First Class
Posts: 163
Joined: Wed Oct 06, 2004 6:51 pm
Contact:

Post by SilverFox » Wed Jan 04, 2006 5:58 pm

DTRemenak wrote:Silverfox: You can run bzfscron commands in the crontab. So do something like:
Well, that'll accomplish what I'd like (except for the ability to create compartmentalized "task lists" by file, which could be used for multiple bzfscron's (different servers))

User avatar
The Knights Who Say Ni
Private First Class
Private First Class
Posts: 556
Joined: Mon Sep 26, 2005 7:21 pm
Location: Uplyme, England
Contact:

Post by The Knights Who Say Ni » Fri Jan 06, 2006 11:36 pm

on mine when its 'shot' came up it would do as i said but if i put for example
0 0 * * * /say hello

it would say
BZFS Cron wrote:/say hello
its probably some thing im doing wrong :roll:
Image
Sig Made By AlliedArmour

TGPH

User avatar
Tropican8
Private First Class
Private First Class
Posts: 312
Joined: Fri Mar 18, 2005 11:51 pm
Location: As close to the grove as you can get

Post by Tropican8 » Thu Oct 26, 2006 3:24 am

Greetings. I am trying this plugin on my servers. For the most part it is working wonderfully, however on two of my servers it is crashing/quitting. I'd give an error message, or a detailed explaination of what's happening -dddd, however any time I actually try to observe the crash it never occurs (convenient, eh?).

Both servers are Pillbox-type CTFs and are using fairCTF. Other than that, there is no pattern.

Could this be a plugin conflict?









EDIT: Confirmed, does not occur with fairCTF unloaded

User avatar
optic delusion
Special Forces
Special Forces
Posts: 997
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Post by optic delusion » Sun Sep 30, 2007 10:08 pm

I don't know what happened in 2.0.10RC1, but the intermittent crashes on cron (pseudo-player) join seem to have been solved.

bzfscron used to crash on join about 20 percent of the time, it seems to be fixed in the last week. Is there a reason?

...we're gonna do a real stress-test on it now. make sure it's as good as i think it is.

EDIT: it seems to be functioning perfectly.
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.

Post Reply