duolab
V2EX  ›  问与答

FRP 如何切到前台来?

  •  
  •   duolab · Mar 31, 2020 · 1656 views
    This topic created in 2246 days ago, the information mentioned may be changed or developed.

    2020/03/31 09:11:41 [I] [service.go:157] frps tcp listen on 0.0.0.0:8000 2020/03/31 09:11:41 [I] [service.go:199] http service listen on 0.0.0.0:8080 2020/03/31 09:11:41 [I] [service.go:255] nat hole udp service listen on 0.0.0.0:7001

    比如运行了 ./frps -c ./frps.ini 会出现上面的东西,但是关掉了 ssh 客户端后,再连接服务器就不会显示了,想再次显示还得找到进程 kill -9 结束之,如何把这东西再切回来?谢谢

    5 replies    2020-03-31 12:59:29 +08:00
    ThirdFlame
        1
    ThirdFlame  
       Mar 31, 2020
    `nohup ./frps -c ./frps.ini &`
    看同目录下的 nohup.out `tail -f nohup.out`
    noqwerty
        2
    noqwerty  
       Mar 31, 2020 via Android
    也可以 tmux 跑,或者 pm2 / supervisor 之类的程序监控
    jasonyang9
        3
    jasonyang9  
       Mar 31, 2020 via Android
    造一个 systemd 的服务单元吧,或者搜一下有现成的
    stille
        4
    stille  
       Mar 31, 2020
    用 systemd 控制吧,在 /lib/systemd/system 下创建 frps.service 修改下你自己的 frps 路径,然后 systemctl daemon-reload 生效.

    [Unit]
    Description=Frp Server Service
    After=network.target syslog.target
    Wants=network.target

    [Service]
    Type=simple
    Restart=on-failure
    RestartSec=5s
    ExecStart=/usr/local/frp/frps -c /usr/local/frp/frps.ini

    [Install]
    WantedBy=multi-user.target

    可以使用以下命令:
    sudo systemctl start frps
    sudo systemctl enable frps
    sudo systemctl status frps
    sudo systemctl restart frps
    sudo systemctl stop frps
    KasuganoSoras
        5
    KasuganoSoras  
       Mar 31, 2020
    用楼上说的 systemd 或者使用 screen
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1491 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 16:46 · PVG 00:46 · LAX 09:46 · JFK 12:46
    ♥ Do have faith in what you're doing.