To set up the frp client to start automatically on boot in Raspberry Pi
To set up the frp client to start automatically on boot in Raspberry Pi:
Open a terminal or SSH into your Raspberry Pi.
Switch to the root user:
sudo -i
- Navigate to the systemd directory:
cd /lib/systemd/system
- Create a new service file for frp client:
nano frpc.service
- Add the following content to the file:
ini
[Unit]
Description=frpc
After=network.target
[Service]
User=root
Type=simple
ExecStartPre=/bin/sleep 10
ExecStart=/usr/local/frp/frpc -c /usr/local/frp/frpc.ini
[Install]
WantedBy=multi-user.target
Note: Make sure to adjust the paths for frpc and its configuration file (frpc.ini) according to your setup.
Save the file and close the nano editor.
Start the frpc service:
systemctl start frpc
- Enable frpc to start on boot:
systemctl enable frpc
Now, the frp client (frpc) will automatically start on boot in your Raspberry Pi. It ensures that the client establishes a connection with the frp server, allowing you to access the monitoring and remote functionality from external networks.
评论
发表评论