[GH-ISSUE #145] 客户端无法开启自启动 #89

Closed
opened 2026-05-05 11:44:21 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @ghsa1994 on GitHub (Oct 25, 2016).
Original GitHub issue: https://github.com/fatedier/frp/issues/145

树莓派平台,无论是在rc.local中还是init.d中写脚本都是无法正常启动,服务端在vps的 Centos 6 x86上的rc.local就能成功自启动,树莓派在家里,没有保证的7*24小时供电!求协助!

Originally created by @ghsa1994 on GitHub (Oct 25, 2016). Original GitHub issue: https://github.com/fatedier/frp/issues/145 树莓派平台,无论是在rc.local中还是init.d中写脚本都是无法正常启动,服务端在vps的 Centos 6 x86上的rc.local就能成功自启动,树莓派在家里,没有保证的7*24小时供电!求协助!
Author
Owner

@jiangchao0304 commented on GitHub (Oct 28, 2016):

自己pi用的 拿走不谢
保存为 frpc 到/etc/init.d
注册为服务 update-rc.d frpc defaults
我的frp放在/opt/frp里 根据你的目录修改

`#!/bin/sh
NAME=frpc
DAEMON=/opt/frp/$NAME
CONFIG=/opt/frp/myfrpc.ini

[ -x "$DAEMON" ] || exit 0

case "$1" in
start)
echo "Starting $NAME..."
start-stop-daemon --start --chuid pi --exec $DAEMON --quiet --oknodo --background -- -c $CONFIG || return 2
;;
stop)
echo "Stopping $NAME..."
start-stop-daemon --stop --exec $DAEMON --quiet --oknodo --retry=TERM/30/KILL/5 || return 2
;;
restart)
$0 stop && sleep 2 && $0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
exit 0
`

<!-- gh-comment-id:256967035 --> @jiangchao0304 commented on GitHub (Oct 28, 2016): 自己pi用的 拿走不谢 保存为 frpc 到/etc/init.d 注册为服务 update-rc.d frpc defaults 我的frp放在/opt/frp里 根据你的目录修改 `#!/bin/sh NAME=frpc DAEMON=/opt/frp/$NAME CONFIG=/opt/frp/myfrpc.ini [ -x "$DAEMON" ] || exit 0 case "$1" in start) echo "Starting $NAME..." start-stop-daemon --start --chuid pi --exec $DAEMON --quiet --oknodo --background -- -c $CONFIG || return 2 ;; stop) echo "Stopping $NAME..." start-stop-daemon --stop --exec $DAEMON --quiet --oknodo --retry=TERM/30/KILL/5 || return 2 ;; restart) $0 stop && sleep 2 && $0 start ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;; esac exit 0 `
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#89
No description provided.