4

Sorry if this is a dumb question but I'm a newbie with these things.
I want to run a chrome extension inside a VPS (DigitalOcean), I have managed to open Chrome and install the extension and is running fine.
Is there some way to warranty the chrome extension is running 24/7 (restart automatically if there is some crash in chrome, or system restart etc)

EDIT:
I have installed "xfce4 and tightvncserver" in my server, and using VNCViewer to access. I run chrome from there. But I'm not sure if Chrome will continue running when I close VNCViewer and also close the SSH Terminal (where I'm starting VNC).
I just want to make sure my chrome extension is running all the time.
I've found this: How can i automatically execute a script after automatic boot? but I cannot find that file (/etc/rc.local)

K7AAY
  • 17,705
Enrique
  • 151
  • 1
  • 5

2 Answers2

1

Enrique's answer above is good, but here's another way.

As per https://help.ubuntu.com/stable/ubuntu-help/startup-applications.html.en you can configure what applications should be started at login, in addition to the default startup applications configured on the system. If Chrome is running, so are its extensions, so you need to launch Chrome at startup. Applications to autostart are typically located in the /usr/bin folder.

http://edoceo.com/gui/xfce-autostart-apps and https://superuser.com/a/1302626/264083 illustrate how to always launch apps at startup time in XFCE. You create a *.desktop file in /etc/xdg/autostart/ for global services (best choice here), and ~/.config/autostart/ for personal ones.

After you create one, it is "enabled" by default, although can still be disabled via xfce4-session-settings. Here's an example:

[Desktop Entry]  
Type=Application  
Name=Google Chrome   
Exec=/usr/bin/google-chrome  
Terminal=false  
K7AAY
  • 17,705
1

It seems in newest Ubuntu versions /etc/rc.local is not available anymore, here are three solutions; first two thanks to
https://www.linuxbabe.com/linux-server/how-to-enable-etcrc-local-with-systemd
1) Use systemd
2) Use crontab (Cron @reboot)
3) Applications > Settings > Session and Startup > configure Google Chrome command there

K7AAY
  • 17,705
Enrique
  • 151
  • 1
  • 5