#873 two rxapi.exe tasks,

4.1.1
closed
none
5
2013-11-22
2010-01-17
No

ooRexx 4.0.0, Windows XP Pro SP3 - sorry I have no idea what "category" value this report should be under

A few days ago I looked at task manager in Windows, and noticed two entries for rxapi.exe. Normally there'd just be one; rxapi.exe does start as a service.

I don't know what caused this. I'd assumed that rxapi would have defined/tested a semaphore/mutex or whatever and even if a second example started, one would die and let the first one carry on.

Discussion

  • Mark Miesfeld

    Mark Miesfeld - 2010-01-18

    The rxapi executable can be started from the command line. If rxapi is already running as a service, this can produce two rxapi rpocesses.

    C:\work>pslist rxapi

    pslist v1.28 - Sysinternals PsList
    Copyright ⌐ 2000-2004 Mark Russinovich
    Sysinternals

    Process information for SDC91593C1:

    Name Pid Pri Thd Hnd Priv CPU Time Elapsed Time
    rxapi 4552 8 2 38 464 0:00:00.046 0:18:34.678

    C:\work>rxapi

    C:\work>pslist rxapi

    pslist v1.28 - Sysinternals PsList
    Copyright ⌐ 2000-2004 Mark Russinovich
    Sysinternals

    Process information for SDC91593C1:

    Name Pid Pri Thd Hnd Priv CPU Time Elapsed Time
    rxapi 4552 8 2 38 464 0:00:00.046 0:18:42.444
    rxapi 3012 8 1 30 500 0:00:00.062 0:00:04.656

    C:\work>

    Only one process can run as a service:

    C:\work>sc stop rxapi

    SERVICE_NAME: rxapi
    TYPE : 10 WIN32_OWN_PROCESS
    STATE : 3 STOP_PENDING
    (STOPPABLE,NOT_PAUSABLE,IGNORES_SHUTDOWN)
    WIN32_EXIT_CODE : 0 (0x0)
    SERVICE_EXIT_CODE : 0 (0x0)
    CHECKPOINT : 0x0
    WAIT_HINT : 0x0

    C:\work>pslist rxapi

    pslist v1.28 - Sysinternals PsList
    Copyright ⌐ 2000-2004 Mark Russinovich
    Sysinternals

    Process information for SDC91593C1:

    Name Pid Pri Thd Hnd Priv CPU Time Elapsed Time
    rxapi 3012 8 1 30 500 0:00:00.062 0:03:29.341

    C:\work>sc stop rxapi
    [SC] ControlService FAILED 1062:

    The service has not been started.

    C:\work>

    You can end the second process using taskmanager or some other process manager:

    C:\work>
    C:\work>
    C:\work>pslist rxapi

    pslist v1.28 - Sysinternals PsList
    Copyright ⌐ 2000-2004 Mark Russinovich
    Sysinternals

    Process information for SDC91593C1:

    Name Pid Pri Thd Hnd Priv CPU Time Elapsed Time
    rxapi 3012 8 1 30 500 0:00:00.062 0:05:42.342

    C:\work>pskill rxapi

    PsKill v1.12 - Terminates processes on local or remote systems
    Copyright (C) 1999-2005 Mark Russinovich
    Sysinternals - www.sysinternals.com

    Process rxapi killed.

    C:\work>pslist rxapi

    pslist v1.28 - Sysinternals PsList
    Copyright ⌐ 2000-2004 Mark Russinovich
    Sysinternals

    Process information for SDC91593C1:

    process rxapi was not found on SDC91593C1

    C:\work>

    rxapi uses sockets to do its work. The first process that starts is going to grab the communication port, so there is no way that I can think of that the second process can hinder the function of rxapi, or does any real harm. So, preventing a second process from starting would not be real high on my list of priorities.

    Of course, if you can come up with a scenario that starts a second rxapi process, that doesn't involve manually staring it from the command line, I'd be intersted in that.

     
  • Jeremy C B Nicoll

    Thanks for comments. I have never manually started rxapi; it would not have occurred to me to do so, because I know it starts automatically...

    It seems to me that that raises the question of how/what might make something else start rxapi twice.

    I can't even quite remember which machine (laptop or desktop) this happened on, as at the time I was too busy to look into it If I see it again I'll see if I can find out when the two started.

    (Some time ago on both machines I turned on, via Admin Tools -> Local Security Policy -> Local Policies -> Audit logging (in the Security EventLog)
    logging of system events, process start/stop etc. It's useful info... but the EventLogs fill up and wrap rapidly; I've not yet started collecting/archiving the info far less integrating it with other logging info, though that's what I plan to do. I miss sorely the sort of syslog one gets on an MVS system.

     
  • Mark Miesfeld

    Mark Miesfeld - 2012-02-06

    Hi Jeremy,

    I'd like to close this bug because we haven't had any other reports of anything similar, I've never seen anything like it and I do really a lot of installs of the Windows packages, and without being able to reproduce it, there is not much we can do anyway.

    If you agree, just go ahead and close this with a resolution of out of date.

    --
    Mark Miesfeld

     
  • Mark Miesfeld

    Mark Miesfeld - 2012-02-10

    I'm going to close this bug as out of date for the reasons stated in my previous comment.

     
  • Jeremy C B Nicoll

    Only a few days ago I noticed I had three (or four, not sure) rxapi tasks running... After a reboot things went back to normal. I've still never manually started a rxapi task. At the time I was too tired/busy to investigate further, but I think I might write some code to look for rxapi tasks and run it frequently (as a scheduled task) to see if I can get any clue why it's happening.

    As things stand, I don't think I've seen any problem that might be caused by multiple rxapi tasks. It could be happening quite often, and I wouldn't notice (because usually my taskmanager display is sorted by CPU% in descending order). I think when I most recently noticed I'd changed the sort to taskname and was looking for something else starting with "R"..

     
  • Jeremy C B Nicoll

    Since I'm not manually starting rxapi, what is?

     
  • Mark Miesfeld

    Mark Miesfeld - 2012-02-17

    Hi Jeremy,

    Okay, I'll leave this one open.

    Originally you reported this on XP with ooRexx 4.0.0. Are you still using ooRexx 4.0.0 on XP? Is rxapi installed as a service on your system?

    The 4.1.0 installer for ooRexx has changes in it to make sure that, when rxapi is installed as a service, it gets installed correctly. Unless you have some reason not to, you should upgrade to 4.1.0.

     
  • Jeremy C B Nicoll

    Yes, still 4.0.0 on XP. Yes, rxapi is installed as a service. (I know that rxapi is normally started as a service; what I was asking below is essentially: what in the way that oorexx works could cause rxapi to be started again.)

    I know I should upgrade to 4.1.0, but I'm chronically ill and finding time to work through the implications of an uninstall & reinstall of any app is always hard.

     
  • Jeremy C B Nicoll

    Yesterday shortly after booting and logging in to Windows my new alert code told me that there were 3 rxapi tasks active. pslist -x and pslist -t commands issued by the monitor exec were logged - I'll upload the file showing their output.

    It boils down to the rxapi system service task starting about 15 seconds AFTER two rexx execs were started by Scheduled Task definitions... which only run after I login to Windows.

    Although yesterday I did log in almost as soon as the login screen was presented, that's not all that unusual. However the schedule for the after-login rexx execs runs them on n-minute boundaries (that being the finest control that Scheduled Tasks offers, and maybe bad luck played its part. Any day that I don't login as soon as the login screen is shown, and/or when the schedule boundary is 16-59 seconds away might be the only reason that this seems intermittent.

    I've experimented by renaming rexx.exe, rexxhide.exe & rexxpaws.exe to have a "disabled-" prefix & found that Scheduled Tasks work ok when the rexx[xxxx].exe it wants to run isn't present - it merely records the tasks concerned as "Could not start". As soon as the .exe's are renamed back to their proper values the next instance of the Scheduled Task works properly.

    I'm going to try using a .bat file, run from Scheduled Tasks as a "at startup" task, to disable the three rexx[xxxx].exe executables, then use something else, probably started when I login, to wait until the rxapi service is running, then re-enable the rexx executables. If that works I may try moving the latter code into the second half of the disabler batch file, though I don't know if I want that running when as an un-logged-in user I can't see it.

    This is not all bad news because I have two other problems with Scheduled Tasks and oorexx anyway. The first is that just saying the command to be run is xyz.rexh (or maybe even C:.....xyz.rexh (I can't remember) runs the exec but flashes open a command window first (though rexh is the extension I associate with rexxhide). I've found if one specifies the Scheduled Task command as

    "C:.....fullpathto\rexxhide.exe" "C:...fullpathto\xyz.rexh"

    it works without the flah of the cmd window. Great, but the second problem is with the gui for defining Scheduled Tasks; if I type in "%REXX_HOME%" as part of a path definition it gets resolved then & there. So I always assumed that sooner or later I'd need to build the set of scheduled tasks dynamically, from an exec which knows where the current version of oorexx is installed.

    That means that code which decided that rxapi is up and it's now safe to define other rexx-related scheduled tasks can also do the latter thing.

    I'll update this when I've made more progress.

     
  • Mark Miesfeld

    Mark Miesfeld - 2012-03-11

    Jeremy,

    This:

    This is not all bad news because I have two other problems with Scheduled
    Tasks and oorexx anyway. The first is that just saying the command to be
    run is xyz.rexh (or maybe even C:.....xyz.rexh (I can't remember) runs the
    exec but flashes open a command window first (though rexh is the extension
    I associate with rexxhide). I've found if one specifies the Scheduled Task
    command as

    "C:.....fullpathto\rexxhide.exe" "C:...fullpathto\xyz.rexh"

    it works without the flah of the cmd window.

    points to your having an old version of ooRexx laying around somewhere. When you don't use the full path to rexxhide, the old rxapi gets started. Older versions of rxapi got started internally through net start. This is what causes the command window to flash. The fact that you have different behaviours when using the full path than when not using the full path is pretty good proof that you have different versions of ooRexx on your system

    You should use some tool to search all your disk drives, including any network mounted drives for rxapi*

     
  • Jeremy C B Nicoll

    Thanks for your idea. Unfortunately V4.0.0 of ooREXX is the only version of it I've ever installed. There's no possibility of remnants of an old version anywhere. Nevertheless I've looked for rxapi.* in C:\Program Files and C:\Windows and only found the expected single instance (and the prefetch copy). (The search was done by a standalone search tool called FileLocatorPro.) I have no network drives.

    It's only in Scheduled Tasks that I have the strange problem with rexxhide; double clicking a ".rexh" exec in Windows Explorer runs them ok. I did define "rexh" and "rexp" (for paws), as well as "rex" in PATHEXT.

    However I assume that the full path to rexxhide is used when the file associations are looked up so that maybe doesn't prove anything. But issuing:

    C:\Documents and Settings\Laptop>rexxhide "C:\My Dropbox\JN_RexxPathLib\Podcast_move-and-renamer.rexh"

    runs the exec without starting another rxapi.

     
  • Mark Miesfeld

    Mark Miesfeld - 2012-03-13

    Committed revision 7651. trunk
    Committed revision 7652. 4.1 fixes

    This commit ensures that if rxapi is installed as a service it will not be restarted if it is already running, or in a start pending state.

    Thanks for your persistance Jeremy. There was a hole where rxapi could be restarted if it was already running, or in a start pending state. I fixed that and as long as rxapi is installed as a service it is no longer possible to start a second instance if one is already running, even if it is started from the command line.

    I'm 99% sure this fixes your problem and it will be available in the next release. Of course you'll have to upgrade to benefit from it.

     
  • Jeremy C B Nicoll

    Thank-you! I do know I need to upgrade sooner or later.

    In an earlier post I said I was going to try running a batch (.BAT) file to disable by renaming various rexx[xxxx].exe files at machine startup. For completeness can I say this didn't work very well, but I found a better way. As you'll know there's a way to tell Windows about files to be deleted or renamed at the next system startup (it's done before services are started I think as the files being renamed may well be service ones). This is often part of a install or uninstall process when that requires a reboot. Anyway there's a CLI program called 'movefile' which lets one set such things up, and also one called 'pendmoves' which lets you see what pending actions are current in Windows at any time. Both are part of the SysInternals utility set. It's better than the .BAT approach (where one can't be sure that an error in such a .BAT file will cause a huge problem, before any user is logged on to see it and fix it) because it's a 'proper' way to interfere with boot processing, and of course it's easy to run three 'movefile' commands during any session to cause the action at the next boot.

     
  • Mark Miesfeld

    Mark Miesfeld - 2012-07-16

    The fix for this item was in the 4.1.1 or 4.1.0 release.

     
  • Rick McGuire

    Rick McGuire - 2013-11-22
    • Pending work items: --> none
    • Group: Next_Release --> 4.1.1
     

Anonymous
Anonymous

Cancel  Add attachments