Commit Graph

24 Commits (d4412aba3e7eabf0725cd72430c08c2dc7eed670)

Author SHA1 Message Date
nirenjan 7f59984357 Ensure notification socket is bound when starting daemon 2022-09-22 21:28:20 -07:00
nirenjan 619d516ccc Add notify API
This change adds a notification API to libx52dcomm. It also pulls in the
logic to join multiple arguments into a single buffer for later use.
2022-09-06 23:19:03 -07:00
nirenjan b822d3aed8 Move command processing into separate thread
This will help in moving a lot of the functionality out of the main
thread, and limit the main thread to just signal handling.
2022-07-27 12:47:53 -07:00
nirenjan d3d32cf278 Block signals on child threads
This change adds logic to block signals on child threads. This is done
so that we can migrate signal handling to the main thread, even if we
add additional threads in the future.
2022-07-27 11:33:44 -07:00
nirenjan 8c8f261c80 Disable use of PID file when running in foreground
When running in foreground, it is likely that it is running within
systemd. In this case, a stale PID file is likely to have a PID that
corresponds to a different process, which can still be kill'ed by the
root user. This results in a false positive that the process is still
running and causes the daemon to abort prematurely.

Fixes #42
2022-05-16 10:33:04 -07:00
nirenjan 2119e00647 Integrate pinelog module logging functionality 2021-11-10 09:29:27 -08:00
nirenjan d8a5a2c3b8 Add daemon command handler loop
This change adds the logic to read a packet from the socket, accept
connections from clients, and close connections from clients that have
hung up. This commit does not yet have support for parsing and handling
the commands, and simply echoes the request back to the client.
2021-11-04 18:32:18 -07:00
nirenjan 5a78492140 Make X52 daemon listen on a Unix socket
This change makes X52 daemon listen on a Unix socket. This is in
preparation for changes that will read from the socket and allow clients
to communicate with and control the daemon.
2021-11-04 13:48:18 -07:00
nirenjan 293ba0a99d Remove duplicate check for default PID file 2021-11-03 11:44:24 -07:00
nirenjan 7f29f5f5fe Add mouse update thread
This change adds a thread to translate thumbstick events to a virtual
mouse.
2021-09-14 17:08:01 -07:00
nirenjan 42850bc4cd Create I/O thread to read and process events
This change adds a separate thread to initialize and read reports from
the supported X52 device. This will then process and raise input events
for a virtual device.
2021-09-14 13:33:36 -07:00
nirenjan 0899df60c2 Add signal handler to dump configuration to disk on SIGUSR1 2021-08-30 10:28:29 -07:00
nirenjan 0fae24b5d0 Allow x52d to daemonize
Prior to this change, x52d could only run in the foreground, regardless
of the value of the foreground flag. This change adds the standard
double-fork routine to daemonize the program.

This change also adds a PID file argument to x52d, which is used to
ensure that only one instance of the x52d daemon is running at any time.
2021-08-04 13:13:12 -07:00
nirenjan f422202ec8 Update translations and logs for setting config parameters 2021-07-26 11:02:38 -07:00
nirenjan bd2dbbb9cc Make thread startup and shutdown logs as INFO 2021-07-26 10:30:29 -07:00
nirenjan 52232b1a14 Stop device threads on daemon termination 2021-07-26 10:12:23 -07:00
nirenjan e0d15961e0 Add signal handlers to handle termination and reload 2021-07-25 15:39:20 -07:00
nirenjan 9941234bbe Replace printf with PINELOG_DEBUG in main 2021-07-25 08:42:12 -07:00
nirenjan 499cad666f Add clock update functionality 2021-07-23 10:13:18 -07:00
nirenjan 50f77119ff Add stub to apply configuration 2021-07-21 10:49:16 -07:00
nirenjan ac8bb6cdd9 Add threads to find and update X52 device 2021-07-21 00:01:49 -07:00
nirenjan ab946b4a1a Add device manager implementation 2021-07-16 00:30:27 -07:00
nirenjan fc9bebbe5a Add noreturn attribute to fix compiler warnings 2021-07-15 17:57:51 -07:00
nirenjan cbe7f00a5a Add daemon framework
This change adds the daemon configuration parser and command line
argument parser. This also adds the associated strings to the
translation files, and integrates the daemon into the existing autotools
build framework.
2021-07-15 15:53:56 -07:00