marfersel / LODI

Linked Open Data Inspector
12 stars 3 forks source link

Init script for automation in servers #2

Closed ralcazar-oeg closed 6 years ago

ralcazar-oeg commented 6 years ago

Hola Marcos We are using LODI and executing it manually (screen+node start and pm2).

We are looking for a way to launch it automatically when the server boots. We tried to use some scripts (with nohup, etc) but It doesn't work.

Have you tested/tried a way to launch it automatically when the server boots or a script that could be executed? Thanks!

marfersel commented 6 years ago

Hello!

After trying different solutions, i founded one that works for me:

  1. Open /etc/rc.local file. This file is supposed to be executed at boot.
  2. Write the following commands and save the file: cd /path/to/LODI/ node start.js &
  3. Restart the service that uses rc.local, as following: systemctl restart rc-local.service

Once you have completed those steps, you can try to reboot your server and (after a few seconds) LODI is supposed to be working in background.

Please let me know if that works for you.

Regards!

ralcazar-oeg commented 6 years ago

I'll try to use it with su USER -c 'command &' tu run it unpriviledged instead of rooted and then launch pm2 and see if it works. I'll post you the result when I had a spot to reboot it and test, because It's in a production server.

Thank you!