0

I think I'm starting to go mad. I have tried several things by now, and nothing works.

This is on an Ubuntu 22.04 LTS Desktop Version.

I tried this guide: https://www.baeldung.com/linux/run-script-on-startup

My script file is a quite simple, start chromium-browser in kiosk mode with this IP / page.

chromium-browser -kiosk -incognito https://google.com

Saved this file as tiles.sh in /usr/local/ Then I chmod +x tiles.sh

First option I have tried: crontab -e | where I added:

@reboot root /usr/local/tiles.sh

2nd thing I tried was to add it to .profile in the home folder on the bottom line. Nothing...

sh /usr/local/tiles.sh

I have then tried to use Ubuntu's built in "Startup Application Preferences", again nothing... https://itsfoss.com/manage-startup-applications-ubuntu/

Name; Tiles, Path: /usr/local/tiles.sh, I didn't add any comments.

4th thing was with a tiles.service added to the systemctl

[Unit]
description=Tiles
[Service]
Type=simple
ExecStart=/bin/bash /usr/local/tiles.sh
[Install]
WantedBy=multi-user.target

chmod 644 /etc/systemd/system/tiles.service

systemctl enable tiles.service

systemctl start tiles.service

reboot


So, can someone please tell me what I'm doing wrong here?

Edit:

  • So I fixed a copy-paste error with missing /, so the path looked incomplete

  • A comment suggested that 'crontab -e' is only for 'on boot' stuff, so this wouldn't work.

rca
  • 1

2 Answers2

2

Cron has its own PATH, which is hard coded and set to:

/usr/bin:/bin

This means that only programs installed in those two directories can be launched by name through cron. Firefox is installed at /usr/bin/firefox, so firefox is enough for cron to find it, but chromium is installed as a snap package and is most likely at /snap/bin/chromium. This means your script can't find it as chromium and instead needs the full path. It should work if you change your script to:

/snap/bin/chromium-browser -kiosk -incognito https://google.com

In general, you can run type command to find the path to a command. So type chromium-browser will give you the path to the executable.

terdon
  • 104,119
0

The fix was to sudo apt purge chromium-browser -y and switch to firefox

Artur Meinild
  • 31,035
rca
  • 1