aristosv
Posts: 159
Joined: Mon Dec 08, 2014 7:47 pm

run fbi as a systemd service - no output to TV

Sun Dec 02, 2018 8:28 am

I am currently using this command to display a slideshow of images on a TV.

Code: Select all

fbi -T 3 -a -noverbose -t 4 /var/rpi/media/images/*
I want to use this as a service though, so I can better manage it, get it's status, etc.

So I created this service file /etc/systemd/system/images.service

Code: Select all

[Unit]
Description=Digital Signage Images
After=network.target

[Service]
ExecStart=/usr/bin/fbi -T 3 -a -noverbose -t 4 /var/rpi/media/images/*
Restart=always

[Install]
WantedBy=multi-user.target
Even though it's the exact same command, the TV doesn't show any images.
And even though the log shows that the exit code is 0, the service appears as failed.

Code: Select all

user@ClientX:/etc/systemd/system$ sudo systemctl status images
● images.service - Digital Signage Images
   Loaded: loaded (/etc/systemd/system/images.service; disabled)
   Active: failed (Result: start-limit) since Sun 2018-12-02 10:20:44 EET; 3s ago
  Process: 625 ExecStart=/usr/bin/fbi -T 3 -a -noverbose -t 4 /var/rpi/media/images/* (code=exited, status=0/SUCCESS)
 Main PID: 625 (code=exited, status=0/SUCCESS)

Dec 02 10:20:44 ClientX systemd[1]: images.service holdoff time over, scheduling restart.
Dec 02 10:20:44 ClientX systemd[1]: Stopping Digital Signage Images...
Dec 02 10:20:44 ClientX systemd[1]: Starting Digital Signage Images...
Dec 02 10:20:44 ClientX systemd[1]: images.service start request repeated too quickly, refusing to start.
Dec 02 10:20:44 ClientX systemd[1]: Failed to start Digital Signage Images.
Dec 02 10:20:44 ClientX systemd[1]: Unit images.service entered failed state.
It has been suggested to me that because I am running this as a service, fbi doesn't know on which tty to show the images. So I tried various things, like adding these under the [Service] section.

Code: Select all

StandardInput=tty
StandardOutput=tty
TTYPath=/dev/fb0 (also tried /dev/tty0 and /dev/tty1 here)
or even running it like this

Code: Select all

ExecStart=/bin/bash -c "export DISPLAY=:0.0 ; /usr/bin/fbi -T 3 -a -noverbose -t 4 /var/rpi/media/images/*"
But again, no luck.

Any suggestions are appreciated.

aristosv
Posts: 159
Joined: Mon Dec 08, 2014 7:47 pm

Re: run fbi as a systemd service - no output to TV

Sun Dec 02, 2018 8:51 pm

eventually I used fim. It worked right away.

Return to “General discussion”