61 Commits
Author SHA1 Message Date
Justin Clark-Casey 528bd10af1 Add verbose option.
You now won't get the spew about comamnds executed, etc. unless you specify -v
2014-09-17 21:54:53 +01:00
Justin Clark-Casey 2dd3a60a18 Make active/inactive status reporting stand out a bit more in osimctrl 2014-09-09 00:50:44 +01:00
Justin Clark-Casey 066c1febd8 Change the --noattach switch to --attach on osimctrl start and restart commands. Always attaching by default is too annoying when you know that things work. 2014-06-05 17:48:37 +01:00
Justin Clark-Casey 507c48db52 Make indentation conform to much more readable 4-space rather than 2-space
Yes, I should have done this originally...
2014-06-02 18:48:51 +01:00
Justin Clark-Casey f9167af677 Also use full screen name in stop command 2014-05-29 18:05:18 +01:00
Justin Clark-Casey 8dca477af7 If we have screen names with the same prefix (e.g. sim1 and sim10), attach to the right one by using the full <pid>.<name> in attach rather than just <name>
It turns out that the screen utility will attach to the first screen which has a partial match for the name.
So "screen -x sim1" can attach to a screen named sim10 even if sim1 exists
2014-05-29 18:01:29 +01:00
Justin Clark-Casey 1552ef9fb9 Add optional switches config parameter 2014-05-28 22:44:40 +01:00
Justin Clark-Casey e60b906b60 Any uncaught signal (including SIGUSR1) will terminate mono. So only send if child command name is bash 2014-02-19 16:34:39 +00:00
Justin Clark-Casey 2e7d4575a7 Use SIGUSR1 instead of SIGTERM to signal the bash loop that it should not autoretart after next quit
In my tests I failed to realize that SIGTERM does shut mono down (when not using autorestart)
SIGTERM is not an appropriate signal here anyway
2014-02-19 16:19:48 +00:00
Justin Clark-Casey 84b2bbd73d Fix bug in component restart 2014-02-19 16:08:43 +00:00
Justin Clark-Casey 6f70430330 Always check that binaryPath to component exists to produce a more meaningful error message 2014-02-19 15:59:55 +00:00
Justin Clark-Casey 3e0c212395 Require main config parameters in config.py, which is normally created by copying config.py.example and changing the required parameters 2014-02-19 15:52:14 +00:00
Justin Clark-Casey f8edfb7b99 Add --autorestart option for automatically restarting crashed components. 2014-02-19 00:39:59 +00:00
Justin Clark-Casey 2fe04264fe minor: correct spelling mistake in --noattach help 2014-02-18 20:14:40 +00:00
Justin Clark-Casey 059cc0f2ba Make screen commands return True or False on success or failure. Add method doc to OSimCtrl 2014-02-17 21:29:27 +00:00
Justin Clark-Casey ed36d9ed09 Implement restart as full method 2014-02-17 21:13:42 +00:00
Justin Clark-Casey 7fd30ae075 Add restart command 2014-02-17 21:11:09 +00:00
Justin Clark-Casey 9c11a8c647 Add --noattach option 2014-02-17 21:07:20 +00:00
Justin Clark-Casey 27b6c8b611 Allow mono path/switches to be set differently 2014-02-17 20:56:48 +00:00
Justin Clark-Casey 3ef4616bc1 Move common argument parsing code into main() function in osimctrl 2014-02-17 20:50:46 +00:00
Justin Clark-Casey 9af9d0f42d Generate command help instead of hard-coding 2014-02-17 20:30:33 +00:00
Justin Clark-Casey 14e797c3a7 Move available commands list into osimctrl object 2014-02-13 20:48:15 +00:00
Justin Clark-Casey a79de38170 Use screen constant in osimctrl.getScreenList() 2014-02-13 20:46:12 +00:00
Justin Clark-Casey 42486e7e4a Bring findScreen command inside osimctrl class
So that we can get rid of passing screen name every time
And allow screen path to be used in getScreenList() in a subsequent commit
2014-02-13 20:45:00 +00:00
Justin Clark-Casey f1d4ff9094 minor: change status to Active and inactive rather than running and stopped, since we can't currently tell if a component is really running or starting up/shutting down 2014-02-13 20:39:45 +00:00
Justin Clark-Casey 7cbba775d3 Implementing polling for stop command so that we don't exist until the screen instance has disappeared
A far from perfect solution (will have issues if something was already on the opensim command line)
Difficult to do more without plugging in more directly to opensim
2014-02-13 20:33:49 +00:00
Justin Clark-Casey e18ba7f7b5 First implementation of stop command.
This doesn't currently wait for the screen process to terminate so needs to be improved
2014-02-13 19:50:30 +00:00
Justin Clark-Casey 659b1c8aca Make screen path configurable 2014-02-13 19:14:03 +00:00
Justin Clark-Casey 0177b24be6 make osimctrl into a class rather than a bunch of functions 2014-02-13 19:08:51 +00:00
Justin Clark-Casey 2f5d7845d2 minor: make sections of robustctrl.py clearer 2014-02-13 18:53:27 +00:00
Justin Clark-Casey c17032176e also change osimctrl import in robustctrl.py 2014-02-13 18:52:42 +00:00
Justin Clark-Casey f8f4dc9986 rename ctrl.py to osimctrl.py 2014-02-13 18:49:56 +00:00
Justin Clark-Casey bd3cc93cb6 minor formatting changes 2014-02-13 18:47:27 +00:00
Justin Clark-Casey 332c0311f9 Remove pyc files that should not have got in 2014-02-05 01:24:19 +00:00
Justin Clark-Casey 4536b948b8 Add back in OpenSimulator path print out on status. 2014-02-05 01:23:49 +00:00
Justin Clark-Casey 77de602b6b Remove the PIDfile checking. This is really more trouble than it's worth. Rely solely on screen names 2014-02-05 01:20:42 +00:00
Justin Clark-Casey d5cc173320 Adjust README.md to be more eplicit about osimctrl current goals and provide better instructions 2014-02-05 00:44:55 +00:00
Justin Clark-Casey ad878e6371 Use subpprocess.Popen() to execute command since subprocess.check_output() was only introduced in python 2.7 2014-02-05 00:20:07 +00:00
Justin Clark-Casey a7bd68f6c2 remove <command> metavar from ctrl scripts so that all options appear in help
better for user and had enough of trying to make argparse do unnatural things
2014-02-04 23:56:35 +00:00
Justin Clark-Casey 8559430aea Add --help by using argparse to parse command line arguments instead of hand-rolling 2014-02-04 23:50:53 +00:00
Justin Clark-Casey 4074af6249 If screen is already started on start, don't treat this as an error, just inform the user 2014-02-04 21:14:22 +00:00
Justin Clark-Casey 3ceda85314 Add attach command for attaching to relevant screen instances 2014-02-04 01:14:12 +00:00
Justin Clark-Casey 3a2a77334c Add status command 2014-02-04 01:10:08 +00:00
Justin Clark-Casey 95e3d5887a Make component starting automatically jump into screen on success 2014-02-04 00:29:21 +00:00
Justin Clark-Casey 9b1e65af06 Add robustctrl.py for controlling robust instances. 2014-02-04 00:26:28 +00:00
Justin Clark-Casey 60c40b6b26 split common control methods into separate module 2014-02-04 00:18:14 +00:00
Justin Clark-Casey fc7d8ea47b Replace another hardcoded "OpenSim" that I missed 2014-02-03 21:48:30 +00:00
Justin Clark-Casey d7b7cd0643 Replace hard-coded "OpenSim" strings with screenName or componentName as appropriate 2014-02-03 21:16:20 +00:00
Justin Clark-Casey f8ca4e24f4 Add advice about deleting pid file if opensim has not started 2014-02-03 21:05:31 +00:00
Justin Clark-Casey 67d368c284 refactor start code into startComponent function 2014-02-03 21:04:37 +00:00