Xvfb, or X virtual frame buffer is needed by selenium and chromedriver or gekodriver, so it can srun via cron with your PC locked, or without your script taking focus from the user section
-
yum install xorg-x11-server-Xvfb
-
Copy below to /etc/systemd/system/Xvfb.service
[Unit] Description=X Virtual Frame Buffer Service After=network.target [Service] ExecStart=/usr/bin/Xvfb :99 -screen 0 1024x768x24 [Install] WantedBy=multi-user.target
-
chmod +x /etc/systemd/system/Xvfb.service
-
systemctl enable Xvfb.service
-
systemctl start Xvfb.service