Feh app won't launch inside custom autologin root script

Creating a bug report/issue

I have searched the existing open and closed issues

This seems related :

Required Information

  • DietPi version | cat /boot/dietpi/.version
  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN
    bookworm 1
  • Kernel version | uname -a
    Linux DietPi 6.1.21+ #1642 Mon Apr 3 17:19:14 BST 2023 armv6l GNU/Linux
  • Architecture | dpkg --print-architecture
  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)
    RPi B (armv6l)
  • Power supply used | (EG: 5V 1A RAVpower)
    5V 1A
  • SD card used | (EG: SanDisk ultra)
    Sandisk Ultra class 6

Additional Information (if applicable)

  • dietpi-autostart / feh
  • Was the software title installed freshly or updated/migrated? Nope
  • Can this issue be replicated on a fresh installation of DietPi? Yep

Steps to reproduce

  1. Install dietpi (amazing I love it)
  2. apt install feh
  3. Paste feh command inside custom.sh

Expected behaviour

Launch feh (⌒▽⌒)☆

Actual behaviour

Not launching feh (ノД`)・゜・。

Extra details

cat /var/lib/dietpi/dietpi-autostart/custom.sh

# DietPi-AutoStart custom script
# Location: /var/lib/dietpi/dietpi-autostart/custom.sh
# dietpi-update
logger -s "X started ? Launching feh in 1min" 2>> /var/log/memes.log
sleep 2m
logger -s "sleep done"  2>> /var/log/memes.log
sudo feh -Y -x -D 15 -B black -F -Z -z -r --debug /home/dietpi/memes/ > /var/log/feh-autostart.log 2>&1 &
logger -s "feh running ?" 2>> /var/log/memes.log
exit 0

feh is not launching even if I run it custom.sh manually, logger commands print stuff inside /var/log/memes.log, but nothing for /var/log/feh-autostart.log, running this feh command does work outside of the script.

root@DietPi:/var/log# systemctl status dietpi-autostart_custom
Unit dietpi-autostart_custom.service could not be found.

I’m pretty sure I’m missing something realllly obvious here, but I’m stuck, thank you to anyone reading this, or even helping, and thanks to anyone involved in dietpi, this os is really really amazing <3


Can you try using the absolute path to feh rather then just the command.
To get the full path: which feh

Thank you so much @Jappe !

Still not launching with /usr/bin/feh, this time my feh-autostart.log is created but it’s empty, and this time memes.log is empty too. Inside « steps to reproduce » I forgot to say I configured auto login custom autostart settings, but maybe it’s obvious.

permissions correct?

Thank you @WarHawk !
On which file ? custom.sh ? I did chmod +x on it, ls -la :
-rwxr-xr-x 1 root root 419 Dec 19 02:21 custom.sh
Also autologin is root so I guess it may be something else ? For feh I’m not sure I would need to do something permissions related but :
-rwxr-xr-x 1 root root 200432 Jan 31 2023 /usr/bin/feh

also startx could be problematic since it is an foreground process, which will block the shell until it exits again.
you can try and add a trailing & to the commands to fork it into background.

As a first step, you should put the automatic login aside. Try to get your script running like you go to execute it manually from CLI.


Thanks @Jappe @Joulinar a LOT for your help !! !

Actually, totally wrong call from my side here, I misunderstood the custom script with autologin (17), I thought it would be possible to startx then launch /usr/bin/feh inside X !

What did work was to use autostart (2) Desktop Automatic Login then edit this file :

I have no idea if this “feature” needs to be added inside Other category in dietpi-autostart or if it is only me that doesn’t understand things the right way.

( ‘з’)/

1 Like