I'm quite new to linux and oorexx (I have used classic rexx on OS/2
and Windows often, though). So I do not even know if this is a problem
of oorexx or my linux installation.
Anyway, any thoughts, anyone?
Ralf
Which version of ooRexx?
Do you have the proper 'exit' at the end of the program?
Sincerely,
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/
Open Object Rexx Version 4.0.0
Build date: Oct 8 2009
I had to compile it myself for the SheevaPlug. My rexx programs/
scripts, wich I migrated from windows, work and exit flawlessly when
started from command line.
> Do you have the proper 'exit' at the end of the program?
Yes, checked that first. Even tried different exit codes ('exit 1',
'exit 255' etc.), no difference. Also tried running my rexx-scripts as
root (via /etc/crontab). I tried 'direct' calls ('/opt/ooRexx/bin/
rexx /opt/ooRexx/bin/myscript') vs. shebang. Even tried starting rexx
from a 'wrapper'-shellscript. It all makes no difference here.
Ralf
Actually, this left over process seems to get created by oorexx as a
child process, at least when started by cron on my machine.
A oorexx bug, maybe?
Ralf
I think, each current rexx implementation starts (several) deamons/
services:
(on computer startup or first invocation), f.e.:
rxstack, rxqueue (Regina), ... some kind of MacroSpaceManager, etc.
I don't know, what it is in your case, but it migtht help to 'netstat'
'-an' or '-tua'
hth
Wolfgang
> I think, each current rexx implementation starts (several) deamons/
> services:
This idle rexx instance is left over on each cron run of an rexx
script. I. e., after 4 runs of the script there are 4 idle instances
of rexx, waiting for something, each consuming about 4 MB of RAM. All
these processes can't be daemons/services.
BTW, on my windows machines the regina stack service is configurable
like any other service. If oorexx had a feature like that, it would be
configurable as well (and, at least, mentioned in its documentation).
Ralf
No, if its just rexx that's left, that's not one of the daemons.
If it possible that your cron task is simply not exiting? Possible
reasons might be:
1. You coded 'exit' instead of just exit, so your code carried on
2. You have a "Trace ?" statement which executes only when the code is
running as a cron task
3. You have a Pull/Parse Pull statement (same as #2)
If this were my code, I'd make sure there was just ONE exit, by using
"Call exit" instead of "Exit", then adding:
Exit:
'touch /home/9ral4f/exit_time' /* Change file to suit */
Exit
This way, you could look at the timestamp of the file, to see if the
"Exit:" routine had been called.
--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
> If it possible that your cron task is simply not exiting? Possible
> reasons might be:
> ...
Even this rexx code, executed by cron, leads to an left over rexx
process on my machine:
>>>(begin)
#!/opt/ooRexx/bin/rexx
say 'I am Rexx'
exit
<<<(end)
I thought after that I would rule out any faulty rexx scripting on my
side... :-)
When using any useful rexx program (let's call it
'nameofmyrexxprogram') I can actually see what's happening, using htop
in tree view:
1. cron starts bash as a child process
2. bash starts '/opt/ooRexx/bin/rexx nameofmyrexxprogramm' as a child
3. rexx runs, nameofmyrexxprogram is executing
4. before or while running, /opt/ooRexx/bin/rexx CREATES A CHILD
PROCESS with same name ('/opt/ooRexx/bin/rexx nameofmyrexxprogram').
5. after successful execution of the rexx program, /opt/ooRexx/bin/
rexx (the parent instance) exits WITHOUT CLOSING IT'S CHILD PROCESS
6. bash closes
7. cron sends mail to crontab-owner
8. rexx's former child process keeps idling away in memory, according
to strace waiting forever for an FUTEX event
For me it seems that the main instance of rexx fails to create the
FUTEX event it's child process is waiting for. To my very, very
limited knowledge FUTEX calls are often used to reserve shared memory.
IF rexx's child process is created to reserve memory for rexx and IF
rexx's main process is supposed to call a FUTEX function to free
reserved memory and thereby closing it's child process, THEN MAYBE
there is a bug in oorexx.
Despite the unusual hardware I'm running I have a quite normal ubuntu
9.04 (in it's armel incarnation). I've changed nothing about cron. I
compiled ooRexx from it's 'stable' v4 tarball, changed nothing. Only
ooRexx shows this behaviour on my machine, other binary programs run
fine with cron.
Ralf
Are you sure you're picking up the 4.0.0 version? Previous versions
used shared memory, but that was all removed in 4.0. The only place
where any sort of child process with the same name might be created is
in some of the code involved with issuing shell commands in some
situations, but your small sample would not be hitting that code path.
Rick
>
> Ralf
> Are you sure you're picking up the 4.0.0 version?
Quite. I downloaded ooRexx-4.0.0.tar.gz following the link on
http://www.oorexx.org/, untared it and did what unix-like-build.txt
told me... :-)
This is what 'rexx -v' says:
-------------------------------------------
Open Object Rexx Version 4.0.0
Build date: Oct 8 2009
Addressing Mode: 32
Copyright (c) IBM Corporation 1995, 2004.
Copyright (c) RexxLA 2005-2009.
All Rights Reserved.
This program and the accompanying materials
are made available under the terms of the Common Public License v1.0
which accompanies this distribution.
http://www.oorexx.org/license.html
Syntax is "rexx [-v] filename [arguments]"
or "rexx [-e] program_string [arguments]".
-------------------------------------------
Also there never has been any other rexx installed on this fairly new
box.
Ralf
> I think, each current rexx implementation starts (several) deamons
'oorexx' isn't 'rexx'. Or 'oorexx' is the deamon started by Rexx.
---