go-rod / rod

A Chrome DevTools Protocol driver for web automation and scraping.

Home Page:https://go-rod.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Just a recipe to run a go-rod program as systemd service

chmike opened this issue · comments

Rod Version: v0.116.0

I wrote my first go-rod program using Chromium that works fine. I then wanted to run it nightly and this is when the trouble started as we can’t launch chromium from a cron job due to systemd cgroup sandboxing when chromium is a snap for instance as it is on Ubuntu.

After some research and testing I found the solution. You may want to post a reference to it in your FAQ in case someone experience the same problem as me.

Here is the link to the askubuntu question.

I also did something similar, but the approach is different. I use the golang cron job library and docker, if you use docker restart=always it will survive after system reboot.