clienthandler.py

tcprocd client handler.

class tcprocd.clienthandler.ClientHandler(request, client_address, server)[source]

Bases: socketserver.StreamRequestHandler

Started by TCPServer for every client.

Parameters:
  • request
  • client_address
  • server
user = None

username of the connected user

send_version()[source]

Send the version to the client.

_authenticate_unix_domain()[source]
_authenticate_tcp()[source]
authenticate()[source]

Authenticate, set the username and return the status.

Returns:bool - Whether the authentication succeeded.
handle_command()[source]

Wait for a command and handle it.

handle()[source]

Wait for messages until connection closes.

Called when the thread starts.

Append the handler to handlers of the assigned server and send the version information to the client. authenticate, set username and call _message_router for each message.

exec_command(command)[source]

Execute the given line starting with the command.

do_list()[source]

Return a list of all running servers delimited by ‘n’.

do_start()[source]

Start the given name.

do_kill()[source]

Kill the given process.

do_cat()[source]

Return lines of stdout.

do_command()[source]

Write given message to runners stdin.

get_runner(name)[source]

Return the runner for the given name.

do_attach()[source]

Attach to the shell.

Any further command will be sent to the process. Also this client will receive the console output.

logf(*args)[source]

Format args for logging.