Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
laptopwiki:guides:os:linux:npmsystemdservice [13/02/2023 13:02] – [Stickybot example] dustojnikhummerlaptopwiki:guides:os:linux:npmsystemdservice [13/02/2023 13:04] (current) – [Using a Service File] dustojnikhummer
Line 23: Line 23:
 WantedBy=multi-user.target </code> WantedBy=multi-user.target </code>
   - Copy this file to /etc/systemd/system <code> sudo cp myapp.service /etc/systemd/system </code>   - Copy this file to /etc/systemd/system <code> sudo cp myapp.service /etc/systemd/system </code>
-  - Edit your main.js to include to contain <code>  sudo journalctl -u stickybot.service </code> on the very first line+  - Edit your main.js to include to contain <code> #!/usr/bin/env node </code> on the very first line
   - (Optional but recommended) Convert this file to Unix format. This should prevent incompatibles from [[https://stackoverflow.com/questions/30344858/node-script-executable-not-working-on-mac-env-node-r-no-such-file-or-directo|different carriage return behaviors between Windows and Linux]]   - (Optional but recommended) Convert this file to Unix format. This should prevent incompatibles from [[https://stackoverflow.com/questions/30344858/node-script-executable-not-working-on-mac-env-node-r-no-such-file-or-directo|different carriage return behaviors between Windows and Linux]]
     - Install dos2unix <code> sudo apt install dos2unix</code>     - Install dos2unix <code> sudo apt install dos2unix</code>
  • laptopwiki/guides/os/linux/npmsystemdservice.1676289751.txt.gz
  • Last modified: 13/02/2023 13:02
  • by dustojnikhummer