Daemon Issues
Daemon Won’t Start
Problem
tomat daemon start fails or daemon exits immediately.
Solution
-
Check if already running:
tomat daemon status # If running, stop first: tomat daemon stop -
Check socket permissions:
runtime_dir="${XDG_RUNTIME_DIR:-${TMPDIR:-/tmp}/tomat-$(id -u)}" ls -la "$runtime_dir"/tomat* # Should show socket and PID files with your user ownership -
Run daemon in foreground to see errors:
tomat daemon run # This shows all output directly -
Check runtime directory:
echo "${XDG_RUNTIME_DIR:-${TMPDIR:-/tmp}/tomat-$(id -u)}"Linux normally supplies
$XDG_RUNTIME_DIR. macOS uses a Tomat directory beneath the per-user$TMPDIR. SetTOMAT_RUNTIME_DIRto override both. Tomat creates the directory with mode700when it is missing, but it never changes the permissions of a directory it did not create: if the daemon reports that the runtime directory is writable by other users, tighten it yourself withchmod go-wor pointTOMAT_RUNTIME_DIRsomewhere private.
Daemon Stops Unexpectedly
Problem
Daemon process dies or becomes unresponsive.
Solution
-
Check system logs:
journalctl --user -u tomat.service -f # If using systemd tail -f ~/Library/Logs/tomat.log # If using launchd on macOS -
Check for multiple instances:
ps aux | grep tomat # Kill any duplicate processes -
Clean up stale files:
runtime_dir="${XDG_RUNTIME_DIR:-${TMPDIR:-/tmp}/tomat-$(id -u)}" rm -f "$runtime_dir/tomat.sock" "$runtime_dir/tomat.pid" tomat daemon start
Permission Errors
Problem
“Permission denied” when accessing socket or PID files.
Solution
-
Check file ownership:
runtime_dir="${XDG_RUNTIME_DIR:-${TMPDIR:-/tmp}/tomat-$(id -u)}" ls -la "$runtime_dir"/tomat* # Files should be owned by your user -
Ensure runtime directory exists:
runtime_dir="${XDG_RUNTIME_DIR:-${TMPDIR:-/tmp}/tomat-$(id -u)}" mkdir -p "$runtime_dir" chmod 700 "$runtime_dir" -
Restart daemon:
tomat daemon stop tomat daemon start