Systemd Units

This page contains a detailed description of the function of all systemd units deployed by ansible-digital-signage.

signage-autoreload

signage-autoreload is both a timer and a oneshot service. The timer fires the service at an interval specified by signage_reload_every.

The service runs as the user specified by signage_user.

The service sends ctrl+r to X11 display :0 using xdotool to reload the webpage.

signage-chrome

signage-chrome is a standard service. It is started by signage_refresh.

The service runs as the user specified by signage_user.

signage-chrome is responsible for 3 things:

  1. Turning on the display output identified by detect-primary-display.py and setting the screen orientation per signage_orientation

  2. Starting the browser selected by signage_browser with the URL selected by signage-refresh

  3. Resizing the browser window to fill the screen

Objective #1 is fulfilled through an ExecStartPre directive which runs an xrandr command. Said command reads the display output to configure from a file written by detect-primary-display.py.

Objective #2 is fulfilled by the ExecStart directive. This directive joins together the command specified by signage_browser_command and the contents of a file written by signage-refresh.

Objective #3 is fulfilled by an ExecStartPost directive which runs an xdotool command. This command searches visible windows (so, hopefully only the actual signage window) for anything matching the variable signage_browser_window_name.

signage-display-off

signage-display-off is a simple oneshot service which uses xrandr to disable the video output specified by detect-primary-display.py.

signage-refresh

signage-refresh is the most complicated part of this entire system. It is a oneshot service, a timer, and a python script.

The timer runs the service:

  1. 60 seconds after the player boots

  2. Every time a schedule item starts or ends

The service exists only to run signage-refresh.py, which is run as root.

signage-startx

signage-startx is a standard service, which starts the X11 display server in “rootless” mode (running as the user specified by signage_user). This also creates an “auto-login”, although this X11 session would be fairly difficult to break out of and run arbitrary programs.

signage-startx is set to enabled by the role, and starts with every boot.

X11 is started using the command specified by signage_startx_command.

By default, X11 will run ~/.xinitrc on startup.