I want to launch python script on boot, but rc.local launches it as root, which causes error in my python module. Is it possible to make it run as non root? Instead of nohup python /home/pi/script.py & maybe I could use something which says it to use my non root user?

  • A different option: use crontab and use @reboot instead of the time parameters. Commented Mar 2, 2022 at 15:04

1 Answer 1

su - pi -c 'nohup python /home/pi/script.py' &

See su(1)

  • I tried - now even nohup.out file isnt created
    – Ri Di
    Commented Mar 2, 2022 at 7:30
  • Did you look in /home/pi? Commented Mar 2, 2022 at 8:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .