Commit graph

26 commits

Author SHA1 Message Date
Sebastian Kuzminsky
b21f69e23e realtime script: detect RTAI correctly
The rtai_shm module went away before our Hardy RTAI, so this check has
been broken for years.  rtai_sched now provides the shm device file.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2015-12-27 15:46:01 -07:00
Sebastian Kuzminsky
96026f6fcf realtime script: wait for the last rtapi_app to die when stopping realtime
This is intended to fix a race that causes occasional test failures in
the buildbot, such as this one:

    http://buildbot.linuxcnc.org/buildbot-admin/builders/1502.rip-jessie-amd64/builds/161

Note that runtests ran the test called "edge/falling", which passed,
and then ran the next test, "edge/rising-starting-high", which failed,
complaining "halrun: Realtime already running."

Some background:

    * Both tests are of the "test.hal" type, which get run by halrun.

    * halrun first runs "realtime status" and quits if the status is True,
      as it was in this failure.

    * If the realtime status is False, as it normally is, halrun runs
      "realtime start", then "halcmd test.hal", then "halcmd stop",
      "halcmd unload all", and finally "realtime stop".

    * On uspace, "realtime status" checks for the existence of a running
      "rtapi_app" process.

    * On uspace, "realtime stop" runs "rtapi_app exit".

The theory of this failure is this:

The "edge/falling" test finished, its halrun ran "realtime stop" which
ran "rtapi_app exit" which caused any and all rtapi_app processes to
kill themselves.  But init (or whoever was the parent of rtapi_app)
had not yet gotten around to reaping the dead process, so it was still
around, in Zombie state.  The "edge/rising-starting-high" test started
up, and its halrun ran "realtime status", which now returned True because
it saw the zombie rtapi_app, and the test failed.

I can replicate this failure 100% of the time by stopping init (who's the
father of the "master" rtapi_app) using "sudo gdb /sbin/init -p 1" before
the "edge/falling" test finishes, causing rtapi_app to remain a zombie.

This current commit was proposed by Jeff Epler.  It does not address the
underlying race, but gives init 5 additional seconds to reap the zombie
before giving up, thus making the failure much less likely.

I have a lovely solution to the underlying race, but unfortunately
there's not enough room in this commit message to write it down.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2015-10-20 07:35:03 -06:00
Jeff Epler
1d6c0d0646 configure: Change "sim" to "uspace", with fallout elsewhere 2014-07-20 20:49:08 -05:00
Sebastian Kuzminsky
ed5774497d rename: find rtapi.conf in the new place 2012-01-20 22:11:01 -07:00
Sebastian Kuzminsky
c479755d68 remove obsolete reimplementation of readlink
/bin/readlink is supplied by the coreutils package, which is marked
"Essential: Yes" in both Hardy and Lucid.  So reimplementing it in Perl
seems unnecessary (especially without a dependency on Perl).
2011-08-03 14:49:34 -06:00
Sebastian Kuzminsky
df335383db add "force-reload" to the realtime init.d script
Section 9.3.2 of the Debian Policy Manual
<http://www.debian.org/doc/debian-policy/ch-opersys.html#s-writing-init>
specifies the meaning of the argument to init scripts.

init scripts must accept a "force-reload" command-line argument.  It does
"reload" if supported, and "restart" if not.  The emc2 realtime init
script does not support reload, so "force-reload" does the same as
"restart".
2011-07-17 20:10:47 -07:00
Sebastian Kuzminsky
4452d1bd33 remove the "realtime reload" command-line argument
Section 9.3.2 of the Debian Policy Manual
<http://www.debian.org/doc/debian-policy/ch-opersys.html#s-writing-init>
specifies the meaning of the argument to init scripts.

"reload" means "cause the configuration of the service to be reloaded
without actually stopping and restarting the service", which is not what
ours does.  "reload" is optional, so I'm removing it.
2011-07-17 20:10:15 -07:00
jepler
c8a4e8326c realtime: bail if the kernel version is wrong 2011-01-17 11:34:17 -06:00
Chris Radek
6e6f5f23ea fix incorrect substitution 2010-11-06 12:00:59 -05:00
Norman Yarvin
a763fdcb6e minor portability fixes
Fix hardcoded locations of LSMOD and RTDIR
2010-11-06 10:50:56 -05:00
Jeff Epler
347191085e sim: remove additional shared memory segments
RTAPI_KEY and UUID_KEY shouldn't outlive the realtime session.
2010-06-07 08:12:27 -05:00
Jeff Epler
dc90d1d6d8 put the emc bindir on the PATH when using run-in-place; fixes error 'rtapi_app: command not found' 2007-01-04 19:10:46 +00:00
Jeff Epler
7431392357 improvements for simulator-mode 2006-10-06 21:22:08 +00:00
Jeff Epler
31853d99b8 when using the pure-userspace simulator, there are no modules to load
and no special device to check for
2006-09-30 03:48:37 +00:00
Jeff Epler
2ca95098ed find fuser at configure time, not at runtime 2006-08-26 13:24:53 +00:00
Alex Joni
1ab978ae51 check another plausible location for FUSER (hint: slackware) 2006-08-23 08:26:12 +00:00
Jeff Epler
62a57082c7 CheckLoaded did something useful after all. restore checking for the realtime
shared memory, but remove code for checking module presence since we now error
on failed 'insmod's
2006-07-31 14:06:02 +00:00
Chris Radek
eae340a9fc don't fail if adeos is built into the kerne 2006-07-28 14:53:04 +00:00
Jeff Epler
ecbcf5a8f3 pass along the exit code of 'insmod' back to the caller, and the exit code of 'Load' and 'Unload' to the calling script/program 2006-07-28 12:08:46 +00:00
Jeff Epler
ae85606fa4 speed up the 'realtime' script, including by finding module locations at
compile time rather than using 'find' several times while running 'realtime
start' and 'realtime stop'.  Use subsecond sleep when waiting for the shm
device to appear.
2006-07-12 22:13:29 +00:00
Chris Radek
4901955c0c sometimes we have to wait for udev to create the /dev entry 2006-04-10 00:32:41 +00:00
Alex Joni
653bf6314d added configure touches to .in files 2006-03-29 20:57:32 +00:00
Alex Joni
6bb50ffcff we also need exec_prefix 2006-02-12 22:02:59 +00:00
Chris Radek
6f7974feef no longer need to guess whether we're RIP 2006-02-12 21:56:18 +00:00
Jeff Epler
092ecfd119 Prefer the rtapi.conf next to scripts/realtime so that RIP setups work even when there's an installed version 2006-01-31 20:14:25 +00:00
Chris Radek
4b4560c215 have configure process realtime 2006-01-30 04:48:59 +00:00
Renamed from scripts/realtime (Browse further)