Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autostart kiosk on startup #10

Closed
BrendanBall opened this issue Oct 15, 2019 · 4 comments
Closed

autostart kiosk on startup #10

BrendanBall opened this issue Oct 15, 2019 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@BrendanBall
Copy link

BrendanBall commented Oct 15, 2019

What is the recommended way to autostart grafana-kiosk? If it's systemd can we add a template service file to the repo? I've tried setting it up with the following:

[Unit]
Description=Grafana Kiosk

[Service]
User=pi
Environment="DISPLAY=:0"
Environment="XAUTHORITY=/home/pi/.Xauthority"
ExecStart=/usr/bin/grafana-kiosk --URL <url>  -login-method local -username <username> -password <password> -playlist true

[Install]
WantedBy=graphical.target

This works, except that in the UI chrome complains with a big banner: You are using an unsupported command-line flag: --no-sandbox. Stability and security will suffer. This doesn't come up when I run the same grafana-kiosk command just in command line via ssh.
The blog post was semi helpful, but it is kinda frustrating that it doesn't include how to do the full setup and just ignores the fact that you'd want this to be autostarted

EDIT: the chrome issue is because the service was running as root. I edited it to specify to run the service as the user pi and it works now. Can we add this service file to the repo?

@briangann
Copy link
Collaborator

great idea, let me try this out

@briangann briangann added the enhancement New feature or request label Oct 17, 2019
@briangann briangann self-assigned this Oct 17, 2019
@michaelp85
Copy link

michaelp85 commented Oct 18, 2019

This won't be a reliable way to do it, you're not necessarily guaranteed that the display and window manager will be ready in time. For example for me on slow hardware this wasn't working and was having weird issues like resolution issues.

Better method would be to use your appropriate window manager startup scripts, for me this is; but for others may be xinitrc or similar. This will only fire once window manager is ready and waiting.

/home/pi/.config/lxsession/LXDE-pi/autostart

@xset s noblank
@xset s off
@xset -dpms
@sleep 10
@/usr/bin/grafana-kiosk.linux.armv7 -URL https://xxx.grafana.net/ -login-method gcom -username xxxx -password xxxxxx --kiosk-mode full

@BrendanBall
Copy link
Author

BrendanBall commented Oct 28, 2019

For some reason I didn't get a notification, anyway thanks for the response. @michaelp85 I'm using freedesktop autostart as mentioned in the lxde wiki along with the grafana-kiosk -lxde option which does most of the options you specified with xset according to issue 9. So I just put the following file in /home/pi/.config/autostart/grafana-kiosk.desktop:

[Desktop Entry]
Type=Application
Exec=/usr/bin/grafana-kiosk -lxde ...other arguments

which seems to work. The kiosk has been freezing which I was fixing by just restarting the systemd service, but not sure what made it freeze so will see what happens with this way of running it.

@briangann
Copy link
Collaborator

The above methods and a couple more have been added to the documentation, many thanks to everyone! See PR #22 and the new section https://github.com/grafana/grafana-kiosk#automatic-startup

grafana-kiosk automation moved this from To do to Done Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
grafana-kiosk
  
Done
Development

No branches or pull requests

3 participants