54 lines
1.2 KiB
Text
54 lines
1.2 KiB
Text
|
|
cd terminal
|
|||
|
|
|
|||
|
|
if node js is running - kill process
|
|||
|
|
ss -lntup
|
|||
|
|
kill pid
|
|||
|
|
kill -9 pid // force kill
|
|||
|
|
|
|||
|
|
unzip terminal.zip -d destination_folder
|
|||
|
|
alebo
|
|||
|
|
python pyunzip.py terminal.zip
|
|||
|
|
alebo python pyunzip.py node_modules.zip
|
|||
|
|
|
|||
|
|
|
|||
|
|
----
|
|||
|
|
create service
|
|||
|
|
|
|||
|
|
expres.service
|
|||
|
|
|
|||
|
|
----------------
|
|||
|
|
|
|||
|
|
[Unit]
|
|||
|
|
Description=ExpressJS Server Launcher
|
|||
|
|
After=network.target
|
|||
|
|
|
|||
|
|
[Service]
|
|||
|
|
Type=simple
|
|||
|
|
Restart=always
|
|||
|
|
RestartSec=1
|
|||
|
|
ExecStart=/root/.nvm/versions/node/v12.18.2/bin/node /root/terminal/index.js
|
|||
|
|
WorkingDirectory = /root/terminal
|
|||
|
|
|
|||
|
|
[Install]
|
|||
|
|
WantedBy=multi-user.target
|
|||
|
|
|
|||
|
|
|
|||
|
|
---------------------
|
|||
|
|
|
|||
|
|
copy here: /etc/systemd/system/
|
|||
|
|
|
|||
|
|
---------------------
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
autostart express– location je //etc/systemd/system
|
|||
|
|
vytvorim novy subor “sudo nano expres.service”
|
|||
|
|
whereis node – zistim cestu k node
|
|||
|
|
do ExecStart napisem cestu – napr: “node homeuser/flowserver/index.js” mozno treba aj sudo
|
|||
|
|
spravime ho spustitelnym s “sudo chmod +x expres.service”
|
|||
|
|
aby sa sam spustal dam “sudo systemctl enable expres”
|
|||
|
|
ked uz je nahodou enablenuty treba ho reloadnut s “sudo systemctl daemon-reload”
|
|||
|
|
ked nejde, treba dat pod ExecStart “WorkingDirectory = cesta/na/flowserver”
|
|||
|
|
|
|||
|
|
“sudo reboot” alebo “sudo systemctl reboot”
|