0

My problem is with FBI (frame buffer image viewer) for Linux, but my question and any answers are perhaps applicable to more than only that program. I don't know. Anyway…

While things are loading on my Raspberry Pi, I display a "Loading screen" through HDMI using FBI. The command in my Bash script is:

/usr/bin/fbi -T 1 -noverbose -a /etc/splash/splashscreen.png

After a couple of days, I notice that I get an "Out of memory" error instead of the splash screens. It turns out every time a splash screen was displayed, a new instance of FBI was loaded. So there were 50 frame buffer image viewers open causing the memory error, I guess.

Is there any way of making sure a new instance of a program isn't opened when I call for it, or will I have to do something like:

pkill fbi
/usr/bin/fbi -T 1 -noverbose -a /etc/splash/splashscreen.png
0

use pgrep to find such processes:

if pgrep fbi; then
    echo "already running"
else
    /usr/bin/fbi -T 1 -noverbose -a /etc/splash/splashscreen.png
fi

or, more quietly

pgrep fbi || /usr/bin/fbi -T 1 -noverbose -a /etc/splash/splashscreen.png

You can use pkill -0 in place of pgrep

  • Well, I need to open a new picture in FBI. So using your example won't help. – Paolo Jan 31 '14 at 12:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.