Daemon

Let wsl start without user login. Use tmux to create a fake window and keep writing Logs.

& 'C:\Program Files\WSL\wsl.exe' -e /home/chunibyo/.tmux_startup.sh
#!/bin/bash
 
FLAG_FILE="/tmp/startup_script_executed"
 
if [ ! -f "$FLAG_FILE" ]; then
    # Your commands here
    echo "Running startup commands..."
 
    # Example: Start a new tmux session with specific windows
    tmux new-session -d -s my_session
    tmux new-window -t my_session:1 -n "tmux-startup-window" "while true; do echo 1 > /tmp/tmux_output.txt; sleep 1; done"
 
    # Create the flag file
    touch "$FLAG_FILE"
fi