File: //lib/systemd/system/librechat.service
[Unit]
Description=LibreChat Service
After=network.target
[Service]
Type=simple
# Ensure the environment variables are set (if necessary)
#Environment=NODE_ENV=production
WorkingDirectory=/opt/LibreChat
ExecStart=/opt/LibreChat/start_services.sh
Restart=on-failure
# Use the private /tmp and /var/tmp, which is a new namespace of /tmp and /var/tmp for the process
PrivateTmp=true
# The number of seconds to wait for the service to start before systemd gives up
TimeoutStartSec=30
# The number of seconds to wait for the service to stop before systemd gives up
TimeoutStopSec=30
[Install]
WantedBy=multi-user.target