mirror of
https://github.com/singchia/frontier.git
synced 2026-04-22 16:07:04 +08:00
046309fd7e
* feat: adjust readme * feat: adjust readme * feat: adjust readme * feat: adjust readme * feat: adjust readme * feat: adjust readme * feat: adjust readme * feat: adjust readme
3.8 KiB
3.8 KiB
Frontier Systemd Service
This directory contains files for running Frontier as a systemd service.
Files
frontier.service- systemd service unit fileinstall.sh- automated installation scriptuninstall.sh- automated uninstallation scriptREADME.md- English documentationREADME_cn.md- Chinese documentation
Quick Install
Method 1: Makefile (Recommended)
# Install systemd service via Makefile
sudo make install-systemd
Method 2: Install Script
# Build frontier binary
make frontier
# Run install script as root
sudo ./dist/systemd/install.sh
Method 3: Manual Install
- Build and install frontier:
make install-frontier
- Create user:
sudo useradd --system --no-create-home --shell /bin/false frontier
- Create required directories:
sudo mkdir -p /var/log/frontier /var/lib/frontier
sudo chown -R frontier:frontier /var/log/frontier /var/lib/frontier
- Install service:
sudo cp dist/systemd/frontier.service /etc/systemd/system/
sudo systemctl daemon-reload
Service Management
Enable and Start
# Enable on boot
sudo systemctl enable frontier
# Start service
sudo systemctl start frontier
# Check status
sudo systemctl status frontier
Control
# Start
sudo systemctl start frontier
# Stop
sudo systemctl stop frontier
# Restart
sudo systemctl restart frontier
# Reload config
sudo systemctl reload frontier
Logs
# Follow logs
sudo journalctl -u frontier -f
# Last 100 lines
sudo journalctl -u frontier -n 100
# Time range
sudo journalctl -u frontier --since "2024-01-01" --until "2024-01-02"
Configuration Notes
Service Features
- User isolation: runs as dedicated
frontieruser - Auto restart: restarts automatically on unexpected exits
- Resource limits: includes file descriptor and process limits
- Hardening: includes common systemd security settings
- Logging: logs to systemd journal
Ports
Default listen ports:
30011- Service bound30012- Edge bound
Make sure these ports are allowed by firewall rules.
Config File
The service uses /usr/conf/frontier.yaml by default:
edgebound:
listen:
network: tcp
addr: 0.0.0.0:30012
edgeid_alloc_when_no_idservice_on: true
servicebound:
listen:
network: tcp
addr: 0.0.0.0:30011
Uninstall
Makefile (Recommended)
sudo make uninstall-systemd
Script
sudo ./dist/systemd/uninstall.sh
Manual
# Stop and disable service
sudo systemctl stop frontier
sudo systemctl disable frontier
# Remove service file
sudo rm /etc/systemd/system/frontier.service
sudo systemctl daemon-reload
# Remove user (optional)
sudo userdel frontier
# Remove directories (optional)
sudo rm -rf /var/log/frontier /var/lib/frontier
Troubleshooting
Common Issues
-
Service failed to start
- Check binary:
ls -la /usr/bin/frontier - Check config:
ls -la /usr/conf/frontier.yaml - Check logs:
sudo journalctl -u frontier -n 50
- Check binary:
-
Port conflicts
- Check ports:
sudo netstat -tlnp | grep -E ':(30011|30012)' - Update listen ports in config
- Check ports:
-
Permission issues
- Verify user:
id frontier - Check dir permissions:
ls -la /var/log/frontier /var/lib/frontier
- Verify user:
Debug Mode
sudo systemctl edit frontier
Add:
[Service]
ExecStart=
ExecStart=/usr/bin/frontier --config /usr/conf/frontier.yaml -v 2
Then restart:
sudo systemctl restart frontier
Security Notes
- Run service as non-privileged user
- Keep systemd hardening enabled
- Update Frontier regularly
- Monitor journal logs
- Keep config file permissions strict
Support
If you run into issues:
- Check systemd logs:
journalctl -u frontier - Check Frontier docs
- Open an issue in the repository