Closed poplar-at-twilight closed 4 days ago
docker --restart=always
该邮件从移动设备发送
Can someone share a solution for peerbanhelper to start automatically on Linux platform? 有人可以分享一个 peerbanhelper 可用于 Linux 平台自启动的方案吗?
I tried a few methods myself, but none of them succeeded in starting the jar file automatically at boot time. Manually clicking on the bash script does start the jar. 我自己试了一些方法,但是都没有成功地在开机时自启动 jar 文件。手动点击 bash 脚本倒是可以启动 jar。
The bash script I use is as follows: 我使用的 bash 脚本如下:
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>
如果你用的是systemd,那么你可能需要指定一个工作目录(WorkingDirectory= )供PBH使用
已成功启动,
poplar@c004-h0:/etc/systemd> sudo systemctl status pbh
● pbh.service - Start PeerBanHelper jar file
Loaded: loaded (/etc/systemd/system/pbh.service; enabled; preset: disabled)
Active: active (running) since Sat 2024-06-29 23:03:52 CST; 1s ago
Main PID: 283316 (java)
Tasks: 52 (limit: 18155)
CPU: 3.639s
CGroup: /system.slice/pbh.service
└─283316 /usr/bin/java -jar -Xmx256M -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+ShrinkHeapInSteps -jar /home/poplar/bin/qbee/peerbanhelper/PeerBanHelp>
6月 29 23:03:53 c004-h0 java[283316]: [23:03:53] [main/INFO]: [配置升级实用工具] 请等待检查配置文件更新……
6月 29 23:03:53 c004-h0 java[283316]: [23:03:53] [main/INFO]: [配置升级实用工具] 正在保存更改……
6月 29 23:03:53 c004-h0 java[283316]: [23:03:53] [main/INFO]: + qBittorrent -> qB-EE (http://127.0.0.1:8080)
6月 29 23:03:53 c004-h0 java[283316]: [23:03:53] [main/INFO]: Starting Javalin ...
6月 29 23:03:53 c004-h0 java[283316]: [23:03:53] [main/INFO]: jetty-11.0.20; built: 2024-01-29T21:04:22.394Z; git: 922f8dc188f7011e60d0361de585fd4ac4d63064; jvm 21.0.>
6月 29 23:03:53 c004-h0 java[283316]: [23:03:53] [main/INFO]: Session workerName=node0
6月 29 23:03:53 c004-h0 java[283316]: [23:03:53] [main/INFO]: Started o.e.j.s.ServletContextHandler@7ce4de34{/,null,AVAILABLE}
6月 29 23:03:53 c004-h0 java[283316]: [23:03:53] [main/INFO]: Started ServerConnector@5631962{HTTP/1.1, (http/1.1)}{127.0.0.1:9898}
6月 29 23:03:53 c004-h0 java[283316]: [23:03:53] [main/INFO]: Started Server@42435b98{STARTING}[11.0.20,sto=0] @1719ms
6月 29 23:03:53 c004-h0 java[283316]: [23:03:53] [main/INFO]: Javalin started in 183ms \o/
服务文件:
[Unit]
Description=Start PeerBanHelper jar file
After=multi-user.target
[Service]
ExecStart=/usr/bin/java -jar -Xmx256M -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+ShrinkHeapInSteps -jar /home/poplar/bin/qbee/peerbanhelper/PeerBanHelper.jar nogui
Type=simple
WorkingDirectory=/home/poplar/bin/qbee/peerbanhelper
[Install]
WantedBy=multi-user.target
Can someone share a solution for peerbanhelper to start automatically on Linux platform? 有人可以分享一个 peerbanhelper 可用于 Linux 平台自启动的方案吗?
I tried a few methods myself, but none of them succeeded in starting the jar file automatically at boot time. Manually clicking on the bash script does start the jar. 我自己试了一些方法,但是都没有成功地在开机时自启动 jar 文件。手动点击 bash 脚本倒是可以启动 jar。
The bash script I use is as follows: 我使用的 bash 脚本如下: