2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-18 05:33:17 +00:00

222 Commits

Author SHA1 Message Date
Jarrod Johnson
15ddb554f9 Have sessions deleted on disconnect
When the shell session disconnects, destroy all dependent
sessions.
2016-01-08 14:39:01 -05:00
Jarrod Johnson
4a660d2fb1 Rework session to console relationship
Previously, was using counters to track the relation, also had distinct tracking of users versus
callbacks.  Unify the callback and user into a single 'session' attach and then use the size
of the set of sessions and their declared users rather than trying to maintain a counter on the side.

This change simplifies the relationship, changes away the logging and clientcount counter for
a more robust strategy, and paves the way for the dependent ShellHandler to terminate connected
sessions when the shell session dies.
2016-01-08 11:23:55 -05:00
Jarrod Johnson
849193cf98 Have shell sessions not autoreconnect
Unlike consoles, where the underlying concept is a real
persistent thing that needs some care to reattach to watch,
a shell session should die when it is lost, as a new one would
have to be created anyway.  Modify the disconnect behavior
for a shell session to set closed and notify the receivers.
It should also reap dependent watching objects in a future
change.
2016-01-07 16:51:22 -05:00
Jarrod Johnson
00feca7e5b Have builds include shell plugins
The builds were excluding the ssh plugin, correct the oversight.
2016-01-07 16:15:59 -05:00
Jarrod Johnson
be75018609 Instrument sessions/ collection
This causes some additional features into core.  Namely
the ability to use a fixed module rather than a string
defined plugin.  This allows shellserver to implement the
'plugin' interface without living in 'plugins'.  'plugins'
implies modularity and potential eventual choice, but
this functionality is core.  It would make sense for the
'attributes' plugin to be changed to match this strategy.
2016-01-07 15:36:44 -05:00
Jarrod Johnson
a891745386 Avoid double connect on shell start
When a shell session is initiated, it registers
a recipient at the same time it would be trying
to establish session for not being a 'wait for
recipient'.  Aggressively mark the state as connecting
to avoid the recipient erroneously thinking things have
not be set into motion yet.  Additionally, have the ssh
plugin avoid a traceback when disconnecting before completing
connection.
2016-01-07 10:30:30 -05:00
Jarrod Johnson
46d3779774 Connect shellserver to httpapi
Have httpapi recognize the difference and start a shellserver
session when appropriate.  Next step will be to wire up enumeration of
current shellserver sessions, debug ssh.py traceback, delete on remote
close, and auto-delete when no client connected after some interval (e.g.
30 minutes).
2016-01-06 17:03:10 -05:00
Jarrod Johnson
5d73548583 Use a plain incrementing session id
UUIDs when a simple number will do are harder to use.
Change to a simple increment id.  This could cause an issue
with multiple management nodes, but I think the sessions
should be contained to the instance used.
2016-01-06 11:40:31 -05:00
Jarrod Johnson
8ae8b79837 Fix misuse of console log for shell sessions
console logging assumptions are not valid for shell sessions.
Correct by modifying the buffer init code to be conditional
and adding a stub 'log' to the ShellHandler class.
2016-01-06 11:27:11 -05:00
Jarrod Johnson
0df21ddeb0 Amend core to pass shell objects through
For 'handler' plugin definitions, also recognize
the 'console' exception to allow the plugin to pass
through to the shellserver infrastructure.
2016-01-06 10:06:09 -05:00
Jarrod Johnson
0e821a7bfe Refactor socket api terminal handler
The 'terminal' handler code is broken out to get ready
for using 'shell' as well as 'console'
2016-01-05 16:29:21 -05:00
Jarrod Johnson
30ed563810 Retrofit consoleserver and make shellserver
Provide a common 'shellserver' capability cloned off of 'consoleserver'.
This will enable the concept of per-user shells with option for multiple
shells per.  Each user will have their own set of shell sessions rather
than shared across users.  Can revisit in future if sharing between
users is desired.
2016-01-05 15:34:52 -05:00
Jarrod Johnson
d03ca6eafe Add internal resource for 'shell' 2015-10-28 10:50:27 -04:00
Jarrod Johnson
4d148751e5 Add a module for ssh 'console' API
Create a module that does ssh and treats it like
a console.  The plan is to have a cliserver.py to
behave in a manner resembling consoleserver.py, but
with option to have multiple distinct sessions per
target.
2015-10-28 10:50:22 -04:00
Jarrod Johnson
f02c74cce0 Add facility to dump trace to log
If confluent gets stuck, provide a debug facility
to sample where it is stuck.  Sending confluent
SIGUSR1 will now cause /var/log/confluent/hangtraces
to get written to.
2015-10-28 10:45:18 -04:00
Jarrod Johnson
1cf238708f Amend console API
The console API had a 'wait_for_data' which will never be used.
Also change __init__() so that it can be called via super() to
allow working around IDE complaints.
2015-10-21 16:44:09 -04:00
Jarrod Johnson
9868e55958 Handle unicode string from a console plugin
If a console plugin feels like outputting data
in a unicode string, accept that data by encoding
to utf-8.
2015-10-21 13:24:41 -04:00
Jarrod Johnson
52aaeef506 Have server avoid sending empty data
While the client can handle it now, have the server
avoid needless processing of '' data from a console
provider.  Address it at the deepest level (the
tlvdata implementation) and a place higher up the stack
to avoid hits to log and such.
2015-10-21 10:30:41 -04:00
Jarrod Johnson
76906c191b Replace '/' in '-' in ipmi names
'/' confuses our '/' delimited namespace.  Use '-'
instead.  '_or_' was considered, but other meanings
could be applied other than '/'.
2015-10-19 14:13:02 -04:00
Jarrod Johnson
e53a9f83f4 Change to versioning derivation from git data
Rather than manually curate the VERSION, use git tags
and auto-create intermediate builds with unique identifiers.
Identify both number of commits to indicate order and the git
short rev to see which rev matches.
2015-10-19 14:06:59 -04:00
Jarrod Johnson
31a191cb10 Merge pull request #42 from jjohnson42/fixpidfile
Fix pid file behavior on exit
2015-10-15 09:44:35 -04:00
Jarrod Johnson
8d566c1795 Merge pull request #40 from jufm/timeout
Add support for event ack timeout setting.
2015-10-15 09:44:13 -04:00
Jarrod Johnson
2c2884f80f Fix pid file behavior on exit
Previous change failed to correct the sense of the 'doexit'
function.
2015-10-15 09:39:44 -04:00
Allan Vidal
fe4797857d Add support for event ack timeout setting. 2015-10-15 09:41:13 -03:00
Jarrod Johnson
d4828b2115 Fix pid file creation
The windows support to 'gracefully' deal with no fcntl
incorrectly broke fcntl usage under linux in main.  Fix
the check to be accurate.
2015-10-14 15:30:43 -04:00
Juliana Motira
06f22e7acb Fix unix socket dir creation 2015-10-14 09:53:14 -03:00
Juliana Motira
2245e53ff1 Fix encoded string problem in InputNTPServer 2015-10-13 15:51:37 -03:00
Jarrod Johnson
fbca02e262 Bump version to 1.2 2015-10-13 14:16:02 -04:00
Jarrod Johnson
8c4d33db92 Merge remote-tracking branch 'upstream/master' 2015-10-09 15:00:35 -04:00
Jarrod Johnson
b1240e327f Fix validity of underscore in noderange
A group name may use underscore in name per xCAT syntax.  Fix
grammar to accept _
2015-10-09 14:53:42 -04:00
Juliana Motira
9b52e276cc Implement remote KVM command 2015-10-07 14:16:54 -03:00
Jarrod Johnson
fa545eeaee Merge pull request #20 from jufm/ntpconfig
Implement NTP config command
2015-10-07 13:12:27 -04:00
Juliana Motira
5590b4138e Implement NTP config command 2015-10-07 13:58:38 -03:00
Jarrod Johnson
57a3c6d287 Correct behavior when a node is deleted
When attribute notification is requested, node deletion was not
sent to the watchers.  Address the limitation by notifying on all
attributes for a deleted node.
2015-10-05 09:48:27 -04:00
Jarrod Johnson
b88a135602 Have the config.conf autoinit if needed
If something makes a call out of sequence, attempt
to auto-init.
2015-09-30 14:21:01 -04:00
Jarrod Johnson
1f8bc635a8 Fix erroneous data injection to log replay
When a rollover event was detected, the offset
of the rollover event itself was being read
from the rolled file erroneously.  Skip to
next loop iteration so that the metadata about
the rollover event is properly ignored in building
the text data buffer.
2015-09-30 13:48:04 -04:00
Jarrod Johnson
f78a4d6074 Merge pull request #26 from jjohnson42/windowssupport
Support Windows management server
2015-09-30 10:19:54 -04:00
Jarrod Johnson
d9ed98d58e Merge pull request #28 from jjohnson42/jsonrollevent
Change rollover event to be JSON
2015-09-30 10:19:34 -04:00
Jarrod Johnson
db3320e2ec Merge pull request #29 from jjohnson42/moveleds
Move 'leds' to be a hardware sensor category
2015-09-28 14:44:24 -04:00
Jarrod Johnson
03de545e09 Merge branch 'master' into pr/23 2015-09-28 13:40:34 -04:00
Jarrod Johnson
fcd0e523a0 Merge pull request #21 from jufm/add_dn
Implement domain name command
2015-09-28 13:17:11 -04:00
Jarrod Johnson
0ae2b7acc6 Move 'leds' to be a hardware sensor category
Rather than 'led' being distinct from 'hardware',
have 'leds' be a category of 'hardware' like 'fans'
or other things similarly hardware related.
2015-09-28 11:20:44 -04:00
Jarrod Johnson
c50be7c3f2 Change rollover event to be JSON
The log format for other pieces of data is JSON.
Change the rollover event to be consistent.  Also
do not record the previous name of the log file,
as that isn't used, and the current filename is
likely to change when it too gets rolled over
so there's no practical use of knowing the
no longer valid name for the transaction.
2015-09-28 10:40:48 -04:00
Jarrod Johnson
45f62b5c05 Fix some issues around lock rework
Some scenarios were not accomodated correctly
as well as some references not set either.
2015-09-28 10:19:35 -04:00
Jarrod Johnson
a0e6e0b5c6 Merge branch 'windowssupport' of git://github.com/jjohnson42/confluent into jjohnson42-windowssupport
Additionally, rework locking back to not require any extra files
2015-09-28 09:56:03 -04:00
Jarrod Johnson
9975d57d5e Implement Locking in Windows log code
Under windows, we can't use flock.  However we can
get locking using msvcrt using different, but related
semantics.  Imitate whole file locking by just locking
first byte.  We have to make sure we seek() to the same
place when locking and unlocking, as Windows requires
the offset to be same for both operations.
2015-09-25 16:59:42 -04:00
Juliana Motira
ff213916b6 Handling encoded input strings 2015-09-24 12:08:17 -03:00
chenglch
dc436fda74 Add log rotation support
Add TimedAndSizeRotatingFileHandler which mixes together
the RotatingFileHandler and TimedRotatingFileHandler from
python logging module to process the log data.

Add logrollover event to track the renamed information, so
that console session can read the log data from current log
file and last renamed file.

Global configuration is used by the log handler. The format
of the log section in '/etc/confluent/service.cfg' is like:
[log]
when = m
backup_count = 3
max_bytes = 8192
utc = False
2015-09-23 23:36:46 -04:00
Jarrod Johnson
ad20193309 Make confluent and confluentsrv.py identical
The two files should be identical.  confluentsrv.py exists
only because PyInstaller struggles unless the target is a
'py' file and does not have some namespace conflict with a
module.
2015-09-23 11:58:48 -04:00
Jarrod Johnson
0bd9b08be2 Remove extraneous print statements
Some debug output was in place, remove it.
2015-09-23 11:54:35 -04:00