Process management
status, logs, stop and restart — seeing and managing running servers.
lexer status
lexer logs <pid> [--lines N] [--follow]
lexer stop <pid>
lexer restart <pid>status#
Lists running servers — both background ones and foreground ones:
lexer statusPID SURE YER KIP PORT WATCH DOSYA
77350 12s arkaplan production 3966 hayir /path/app.lexer
77421 4s onplan development 3965 hayir /path/app.lexerYER says where the process runs (whether --background was given) and KIP which mode it is in (--production). These are separate questions: a background process can be in development mode.
Where the records live#
Each process writes a record to ~/.lexer/run/<pid>.json. When the process shuts down gracefully the record is removed. If it is killed with kill -9 the record stays on disk; lexer status notices and cleans it up itself, so no ghost process appears in the list.
logs#
lexer logs 77350
lexer logs 77350 --lines 200
lexer logs 77350 --follow--follow keeps the file open and prints new lines as they arrive, like tail -f.
lexer logs is only meaningful for background processes: in the foreground the output already goes to the terminal and there is no log file.
stop#
lexer stop 77350Stops gracefully: the server stops accepting new connections, finishes the requests in flight and then exits. The record file is removed.
restart#
lexer restart 77350Restarts the process with the same file and the same flags. You do not have to retype the command — the flags it was started with are in the record.
Rebuilding does not change what is running#
This one is easy to miss:
To pick up the change you must stop and restart:
lexer stop <pid>
lexer serve app.lexer --backgroundIf you are working inside the repository, make lexer-rebuild and make lexer-status list still-running servers via ps — lexer status only sees processes started by a version that can register itself, and cannot see servers opened with an older binary.
Next#
Cache — lexer cache.