| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Add "cmd" field to json that provides the original command string, so it is
provided with the output and the return code.
|
|
|
|
| |
Add retcode field to specify return code of shell invocation.
|
|
|
|
|
|
|
|
|
|
| |
The following log message is display for each ogClient that is connected to
the ogServer:
Sent refresh to: 192.168.2.200
this tells the ogClient to send his current partition table when the connection
between ogServer <-> ogClient starts. This is not very useful, remove it.
|
|
|
|
|
| |
Until there is TLS support for this, frontend and ogserver needs to be in the
same box by now.
|
|
|
|
|
|
|
|
| |
We need to inspect the received payload if any error is raised related
to the X-Sequence header. Not just when a malformed X-Sequence header is
detected.
Fixes: d2c19ef13d7 ("core: add X-Sequence header support")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add non-standard HTTP header "X-Sequence" to the header section of
requests (og_send_request) sent to a connected client.
Define a starting sequence number when creating a new instance of struct
og_client inside og_server_accept_cb. This sequence number is
incremented by one for each outgoing request from ogServer.
This sequence number is checked when receiving a response from a
connected client, if they do not match the connection is dropped.
Use sequence 0 for out-of-band commands (reboot, poweroff, stop). Any
client response with header "X-Sequence: 0" bypasses sequence check.
|
|
|
|
| |
REST API request does not need to perform a list lookup on the wol list.
|
|
|
|
|
| |
Trasient network problems might result in duplicated clients, drop
client object if it already exists before creating a new one.
|
|
|
|
|
| |
Remove legacy behaviour, store it in the client object instead of a temporary
file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Do not release the json object twice, once from og_send_request() and
again og_cmd_free().
Valgrind reports:
==11885== Invalid read of size 8
==11885== at 0x117B9A: json_decref (jansson.h:128)
==11885== by 0x117B9A: og_cmd_free (rest.c:2409)
==11885== by 0x113465: og_agent_deliver_pending_cmd (core.c:211)
==11885== by 0x113465: og_agent_read_cb (core.c:256)
==11885== by 0x4E41D72: ev_invoke_pending (in /usr/lib/x86_64-linux-gnu/libev.so.4.0.0)
==11885== by 0x4E453DD: ev_run (in /usr/lib/x86_64-linux-gnu/libev.so.4.0.0)
==11885== by 0x110C2D: ev_loop (ev.h:835)
==11885== by 0x110C2D: main (main.c:104)
==11885== Address 0x8e7e988 is 8 bytes inside a block of size 72 free'd
==11885== at 0x4C32D3B: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==11885== by 0x117437: json_decref (jansson.h:129)
==11885== by 0x117437: og_send_request (rest.c:330)
==11885== by 0x113454: og_agent_deliver_pending_cmd (core.c:208)
==11885== by 0x113454: og_agent_read_cb (core.c:256)
==11885== by 0x4E41D72: ev_invoke_pending (in /usr/lib/x86_64-linux-gnu/libev.so.4.0.0)
==11885== by 0x4E453DD: ev_run (in /usr/lib/x86_64-linux-gnu/libev.so.4.0.0)
==11885== by 0x110C2D: ev_loop (ev.h:835)
==11885== by 0x110C2D: main (main.c:104)
==11885== Block was alloc'd at
==11885== at 0x4C31B0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==11885== by 0x526461A: json_object (in /usr/lib/x86_64-linux-gnu/libjansson.so.4.11.0)
==11885== by 0x116A07: og_cmd_legacy_image_restore (rest.c:2627)
==11885== by 0x116A07: og_cmd_legacy (rest.c:2757)
==11885== by 0x116A07: og_queue_task_command (rest.c:2848)
==11885== by 0x118284: og_dbi_queue_command (rest.c:3109)
==11885== by 0x118284: og_schedule_run (rest.c:3190)
==11885== by 0x1147B9: og_agent_timer_cb (schedule.c:445)
==11885== by 0x4E41D72: ev_invoke_pending (in /usr/lib/x86_64-linux-gnu/libev.so.4.0.0)
==11885== by 0x4E453DD: ev_run (in /usr/lib/x86_64-linux-gnu/libev.so.4.0.0)
==11885== by 0x110C2D: ev_loop (ev.h:835)
==11885== by 0x110C2D: main (main.c:104)
|
|
|
|
|
| |
as described by man(3) ev, to make it work with ev_timer_again()
otherwise timer might not ever expire.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
200 => successful command, run next pending command
202 => successful command in progress, do not run next pending command
403 => server sent a malformed HTTP header, should not ever happen,
close connection (server is buggy?).
500 => client fails to run command, report error and run next pending command
503 => client is busy, report error and do not run next pending command
Anything else, should not ever happen (client is buggy?), close connection with
client.
On error, when processing response from ogClient, do not close the connection,
instead annotate in the database that command was not successful and run next
pending command.
*Only* if client replies status code 500 set last_cmd to UNSPEC so its state is
not BSY as reported by og_client_status function and pending cmds can be
sent.
|
|
|
|
|
|
|
|
|
|
|
| |
Pending schedule commands can deny ogLive boot of clients due
to filling of pending cmd queue with commands such as "Iniciar Sesión".
For example: Using RemotePC to serve clients that do not boot into
ogLive will fill up the pending command queue with "Iniciar Sesión".
Introduce a safety timeout for pending (scheduled) commands to
avoid this situation.
|
|
|
|
| |
Update license header in files.
|
|
|
|
| |
Socket hidra API has been removed, all connections use a REST API.
|
|
|
|
| |
Needed by the old socket Hydra that does not exist anymore
|
|
|
|
|
| |
WOL_SENT tells that WakeOnLan was sent to computer, after 60 seconds,
if computer does not boot, this state is released.
|
|
|
|
|
| |
Enable TCP keepalive to detect if the ogClient is gone (hard reset). If no reply
after 120 seconds, then release the connection to the client.
|
|
|
|
|
|
|
| |
Some distros enable *.* in syslog.conf to add all logging information
to /var/log/syslog. The existing LOG_DEBUG syslog() entries that ogserver
generates fill up the log files very quickly. Remove most of the LOG_DEBUG
syslog() calls.
|
|
|
|
| |
This API is not supported by ogClient yet and it uses the obsolete socket hydra API.
|
|
Use the same folder as in ogClient.
|