Deploying with systemd
Run FGP daemons as systemd services on Linux.
Create Service File
Create /etc/systemd/system/fgp-browser.service:
[Unit]
Description=FGP Browser Daemon
After=network.target
[Service]
Type=simple
User=your-username
ExecStart=/home/your-username/.cargo/bin/browser-gateway start
Restart=on-failure
RestartSec=5
Environment=RUST_LOG=info
Environment=CHROME_PATH=/usr/bin/google-chrome
[Install]
WantedBy=multi-user.target
Enable and Start
# Reload systemd
sudo systemctl daemon-reload
# Enable on boot
sudo systemctl enable fgp-browser
# Start now
sudo systemctl start fgp-browser
# Check status
sudo systemctl status fgp-browser
View Logs
Multiple Daemons
Create a service file for each daemon:
/etc/systemd/system/fgp-browser.service/etc/systemd/system/fgp-gmail.service/etc/systemd/system/fgp-calendar.service
Or use a template:
# /etc/systemd/system/fgp@.service
[Unit]
Description=FGP %i Daemon
[Service]
Type=simple
User=your-username
ExecStart=/home/your-username/.fgp/services/%i/%i-daemon start
Restart=on-failure
[Install]
WantedBy=multi-user.target
Then:
Socket Permissions
Ensure the socket directory is accessible:
Troubleshooting
Daemon Won't Start
Check logs:
Permission Denied
Ensure user has access to Chrome and socket directories.
Chrome Not Found
Set CHROME_PATH in the service file's Environment directive.