jeff wrote to All <=-
Am I doing this wrong? I changed it so that cron runs the python
script, which generates a semaphore, which then causes the mutil event
to fire. I could do all of this from cron, of course, but I'd rather
use the BBS event system.
Hi, I'm trying to use the events system to get something to run on a schedule (the Puzzle of the Week). The process currently has two steps: a python script runs to generate a text file, and then mutil is used to insert the text file into a message base.
I initially tried using a "Shell" event to do this, but it didn't seem to fire very consistently. The Mystic Events tab would say that the event
was running, but no post was generated and both the mutil and python script logs indicated that no activity had occurred.
Am I doing this wrong? I changed it so that cron runs the python script,
First up are you looking to run something at a set time, once a week? If yes, then a shell event would be my pick and you would set it up forYes, once a week, ideally. However, for testing purposes I have it set up for the day I'm testing (currently Monday) and then I set the time to a few
let's say Monday at 2.15am and have the rest of the days set to No
- your puzzle.sh script sits in the mystic directoryCorrect.
- your puzzle.sh script has correct read/write/execute permissions setCorrect. It successfully executes from cron.
so it will run and create a text file as output
- you have a .ini file called puzzle.ini in your mystic directoryCorrect. The post is successfully created when invoking mutil with this .ini file from either the command line or from a Semaphore event.
- inside that .ini you have a [PostTextFiles] stanza enabled
- the stanza function points to the correct file path and file to be posted - the stanza function sets the number of files to be posted correctly, usually 1
- the rest of the info against file1_xxx config options are correct
What do the MIS logs show when the event runs? Can you paste it up here?The MIS log doesn't show anything; it's as if the event never happened.
I copied the existing .ini file to a new one and made two changes: I changed the message base to a local one (to avoid spamming anyone), and
I upped the log level to 3. Then I created a new Shell event to run the puzzle script and then run mutil with the new .ini file. I set it to run in about 10 minutes, exited the event editor, and restarted mis. I could tell from the server message "Starting 7 event(s)" that it picked up the new event. About 10 minutes later, the event fired and a new puzzle was posted to the local message base.
So then I went back into the event editor and changed the Exec Min field to about 2 minutes in the future and restarted mis. On the Events tab,
the countdown to the new Exec Min was reflected. The time came and
passed, but it seems like the event never fired. There was no update to any log; the python script was not run. I tried again, setting the Exec Min to 10 minutes out, but again it did not fire.
I edited the new event and zeroed out the Exec Hour, set the Exec Min to 1, and changed the event type to interval. I didn't change the commands
to be executed. Three minutes later, I had three new puzzles in the
local message base.
--- Mystic BBS v1.12 A43 2019/03/03 (Raspberry Pi/32)
* Origin: Perceptronica (21:1/180)
Can you share the shell line syntax you used or better still just paste a copy of the screen settings here?No, I can't seem to copy the screen as text.
Your MIS will have recorded this event running as all events are logged using an EVENT class. Here's an example from 21:1/100For whatever reason, it didn't. There's just no entry in the mis.log for the time at which the event should have run. Also, watching the event tab of the mis console, the entry in the TIME column goes from "0d 0h 1m" to "Running" to "Now" to "6d 23h 59m" when the event fires. When the event does not fire, the entry in the TIME column goes from "0d 0h 1m" to "Now" to "6d 23h 59m".
what sort of event were you testing?I made a new Shell event, "Puzzle of the Week TEST", which uses potwtest.ini, which is identical to the potw.ini used by the "Puzzle of the Week" event, except that it has a higher logging level and posts to a local message base rather than the fsxNet one.
That kind of confounds things a bit as you changed event timing and event type. Better to stick with one change to time and leave the event type alone.However, it does give me confidence that the Shell line syntax is correct and can be invoked repeatedly.
For whatever reason, it didn't. There's just no entry in the mis.log for the time at which the event should have run. Also, watching the eventAlso, when the event should fire but doesn't, the LAST EXECUTED column is not updated. It shows the time of the last successful execution or a 1970 date if it has never executed successfully.
tab of the mis console, the entry in the TIME column goes from "0d 0h
1m" to "Running" to "Now" to "6d 23h 59m" when the event fires. When the event does not fire, the entry in the TIME column goes from "0d 0h 1m"
to "Now" to "6d 23h 59m".
The Shell line is: /home/jeff/projects/cryptopuzzle/potw|/home/jeff/bbs/mutil potwtest.ini
Your MIS will have recorded this event running as all events are logg using an EVENT class. Here's an example from 21:1/100For whatever reason, it didn't. There's just no entry in the mis.log for the time at which the event should have run. Also, watching the event
The "Nightly maintenance" event, which is also a Shell event, has so far been firing without fail. I'm never logged in at 4am, so I thought maybe being logged in would inhibit the event, but this turned out not to be
the cause of the Puzzle failures.
what sort of event were you testing?I made a new Shell event, "Puzzle of the Week TEST", which uses potwtest.ini, which is identical to the potw.ini used by the "Puzzle of the Week" event, except that it has a higher logging level and posts to
a local message base rather than the fsxNet one.
Yesterday when I stopped working on it, I'd left the test event as an Interval and disabled it. This morning, I changed it back to a Shell event, set a time for a couple of minutes in the future, re-enabled it, and restarted mis. It fired once, on schedule. Resetting the time and restarting mis again, it would not fire. I tried setting it for a
future time, disabling it, restarting mis, re-enabling it, and
restarting mis again, but it did not fire.
the time at which the event should have run. Also, watching the event tab of the mis console, the entry in the TIME column goes from "0d 0h 1m" to "Running" to "Now" to "6d 23h 59m" when the event fires. When event does not fire, the entry in the TIME column goes from "0d 0h 1m to "Now" to "6d 23h 59m".
Can I suggest putting the potw.sh script in the /bbs directory with the Mystic files.. and instead of specifying a full path just try this forI just tried this... no luck. I shut down mis, made the change, and restarted mis (but didn't log off first). The end of the log has a row of ------- where the restart occurred, the TELNET servers starting up, the BINKP servers starting up, a message about Cryptlib not being detected, a notice about starting 7 event(s), and a message about resetting ghost node 1 (because I didn't log off first. The even should have run 2 minutes later, but that's
the shell line.
./potw.sh|./mutil potwtest.ini
Which tells me nothing is running..That is my assessment as well.
When you say it's working, do you see MIS logging for this to confirm something is being recorded as having happened?Yes. There are three lines in the log at about 4am: a notification that it's running the event, the Cmd being run, and a Res of 0. Also the LAST EXECUTED time is 13 Aug 2019 04:02.
What is the shell syntax for that event?/home/jeff/bbs/mutil maint.ini
..and the time you were attempting to get this event to fire on for it's second, third occasions was some minutes later after the first successful event? e.g. first event 1:25 second event 1:30 and third event 1:36 ?? sort of thing?Exactly that sort of thing.
..and it was a shell event, untouched except for time... and you had closed and restarted MIS?Correct.
I think when you make changes to events it's a good idea to first close MIS, then make the change in config, close config, then restart MIS.. doing otherwise can risk some changes not being applied to MISOk. I did follow this procedure earlier in the message.
Yep it's certainly not running - I agree... but when that next happens watch the main logging screen in MIS and let me know what you see (orThere are no EVENT messages in the log for when the event is supposed to be running.
not) display as an EVENT type during the time the event should be firing
/ running.
I am suspicious that the shell line syntax is not correct somehow or the script being called is not executable from within the directory yourThis was the purpose behind seeing if I could run it as an Interval event... and I can.
copy of mystic is running in.
..and you have it in a directory called \bbs\ not \mystic\ - justCorrect.
checking :)
Yep it's certainly not running - I agree... but when that next happen watch the main logging screen in MIS and let me know what you see (or not) display as an EVENT type during the time the event should be fir / running.There are no EVENT messages in the log for when the event is supposed to be running.
I am suspicious that the shell line syntax is not correct somehow or script being called is not executable from within the directory your copy of mystic is running in.This was the purpose behind seeing if I could run it as an Interval event... and I can.
..and you have it in a directory called \bbs\ not \mystic\ - just checking :)Correct.
Can I suggest putting the potw.sh script in the /bbs directory with t Mystic files.. and instead of specifying a full path just try this fo the shell line.
./potw.sh|./mutil potwtest.iniI just tried this... no luck. I shut down mis, made the change, and restarted mis (but didn't log off first). The end of the log has a row
of ------- where the restart occurred, the TELNET servers starting up,
the BINKP servers starting up, a message about Cryptlib not being detected, a notice about starting 7 event(s), and a message about resetting ghost node 1 (because I didn't log off first. The even should have run 2 minutes later, but that's the end of the log.
Let me save this as a draft and try again, this time logging off...
Nope, it didn't fire. There's no mention of it in the log and the LAST EXECUTED time did not update.
This is the potw script in the bbs directory:
#!/bin/bash
cd /home/jeff/projects/cryptopuzzle
./cryptopuzzle.py
cp PotW.txt /home/jeff/bbs
touch /home/jeff/bbs/semaphore/potw.out
(This script is currently shared by both the test and "real" events. The "real" event is kicked off by cron, creates the semaphore, and then a Semaphore event posts the PotW.txt file to fsxNet. If the test event fires, it does cause the Semaphore event to fire, but by then the
PotW.txt file has been deleted and there's nothing to post.)
When you say it's working, do you see MIS logging for this to confirm something is being recorded as having happened?Yes. There are three lines in the log at about 4am: a notification that it's running the event, the Cmd being run, and a Res of 0. Also the LAST EXECUTED time is 13 Aug 2019 04:02.
What is the shell syntax for that event?/home/jeff/bbs/mutil maint.ini
(I set up the BBS watching your YouTube videos.)
second, third occasions was some minutes later after the first succes event? e.g. first event 1:25 second event 1:30 and third event 1:36 sort of thing?Exactly that sort of thing.
..and it was a shell event, untouched except for time... and you had closed and restarted MIS?Correct.
I think when you make changes to events it's a good idea to first clo MIS, then make the change in config, close config, then restart MIS.. doing otherwise can risk some changes not being applied to MISOk. I did follow this procedure earlier in the message.
question - are you running MIS in daemon mode or MIS Server?I'm running it in server mode. I'm also running it in a screen session. If you're not familiar with screen, it's primarily a program that allows you to run multiple sessions in one terminal window, but it also continues to run if that terminal window is closed; the programs running in each of the sessions still think they're connected to a terminal. And then it can be "reattached"
Sysop: | sneaky |
---|---|
Location: | Ashburton,NZ |
Users: | 31 |
Nodes: | 8 (0 / 8) |
Uptime: | 164:19:14 |
Calls: | 2,077 |
Calls today: | 3 |
Files: | 11,137 |
Messages: | 947,180 |