wt-tracker icon indicating copy to clipboard operation
wt-tracker copied to clipboard

How to turn wt-tracker into service and always run like Nginx

Open duykma2 opened this issue 5 years ago • 8 comments

When I run ./bin/wt-tracker config.json the Terminal showing listening 0.0.0.0:443 listening 0.0.0.0:80 and wt-tracker works perfectly but when I close the Terminal window it will stop wt-tracker. Thanks!

duykma2 avatar Mar 11 '20 12:03 duykma2

hi, i use screen. apt install screen screen ./bin/wt-tracker then press Ctrl+a+d and the team is already working on the screen

Alexdrr avatar Mar 11 '20 12:03 Alexdrr

Thanks! :D

On Wed, Mar 11, 2020 at 7:25 PM Alexdrr [email protected] wrote:

hi, i use screen. apt install screen screen ./bin/wt-tracker then press Ctrl+a+d and the team is already working on the screen

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Novage/wt-tracker/issues/22#issuecomment-597603072, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKILKOWYUL2FACRMSV5DRDLRG57KRANCNFSM4LFUPIRQ .

ghost avatar Mar 11 '20 12:03 ghost

Thanks! It worked for me. But it is not a long term solution, I think.

ghost avatar Mar 11 '20 12:03 ghost

Yes, this is a temporary solution that has been working on my server for more than a month. I couldn’t get to work as a system service.

Alexdrr avatar Mar 11 '20 12:03 Alexdrr

Running a program as a service is very common task that differs depending on OS. If your system supports system.d than you can just create a .service file like:

/etc/systemd/system/tracker.service

[Unit]
Description=WebTorrent Tracker

[Service]
Type=simple
Restart=always
RestartSec=1
User=root
WorkingDirectory=/opt/wt-tracker
ExecStart=/opt/wt-tracker/bin/wt-tracker

[Install]
WantedBy=multi-user.target

mrlika avatar Mar 11 '20 12:03 mrlika

Running a program as a service is very common task that differs depending on OS. If your system supports system.d than you can just create a .service file like:

/etc/systemd/system/tracker.service

[Unit]
Description=WebTorrent Tracker

[Service]
Type=simple
Restart=always
RestartSec=1
User=root
WorkingDirectory=/opt/wt-tracker
ExecStart=/opt/wt-tracker/bin/wt-tracker

[Install]
WantedBy=multi-user.target

You are my savior. Thank you!

ghost avatar Mar 11 '20 13:03 ghost

Running a program as a service is very common task that differs depending on OS. If your system supports system.d than you can just create a .service file like: /etc/systemd/system/tracker.service

[Unit]
Description=WebTorrent Tracker

[Service]
Type=simple
Restart=always
RestartSec=1
User=root
WorkingDirectory=/opt/wt-tracker
ExecStart=/opt/wt-tracker/bin/wt-tracker

[Install]
WantedBy=multi-user.target

You are my savior. Thank you!

as there r "WorkingDirectory=", the "ExecStart=" should not contain that local twice. fix like this " ExecStart=/bin/wt-tracker "

ps: include node local better.

crotel avatar Apr 16 '20 06:04 crotel

i trying to install on ubuntu 18 but getting error 0 info it worked if it ends with ok 1 verbose cli [ 1 verbose cli '/usr/bin/node', 1 verbose cli '/usr/local/bin/npm', 1 verbose cli 'install', 1 verbose cli '-g', 1 verbose cli 'uNetworking/uWebSockets.js' 1 verbose cli ] 2 info using [email protected] 3 info using [email protected] 4 verbose npm-session dbb6f421ca22774d 5 silly install loadCurrentTree 6 silly install readGlobalPackageData 7 silly fetchPackageMetaData error for github:uNetworking/uWebSockets.js premature close 8 timing stage:rollbackFailedOptional Completed in 3ms 9 timing stage:runTopLevelLifecycles Completed in 27405ms 10 verbose stack Error: premature close 10 verbose stack at PassThrough.onclose (/usr/local/lib/node_modules/npm/node_modules/end-of-stream/index.js:47:67) 10 verbose stack at PassThrough.emit (events.js:322:22) 10 verbose stack at emitCloseNT (internal/streams/destroy.js:69:8) 10 verbose stack at processTicksAndRejections (internal/process/task_queues.js:83:21) 11 verbose cwd /root 12 verbose Linux 4.4.0-177-generic 13 verbose argv "/usr/bin/node" "/usr/local/bin/npm" "install" "-g" "uNetworking/uWebSockets.js" 14 verbose node v12.16.3 15 verbose npm v6.14.4 16 error premature close 17 verbose exit [ 1, true ]

fluss45 avatar May 23 '20 15:05 fluss45