Find out what startup downloads are for Raspberry Pi / Linux

apologies for the long question, but I need to be as specific as possible.

I am creating a project that allows me to control the functionality of a camera using a remote control. This project runs from a Python program and translates its output into another program called chdkptp (which is the program that allows me to control the camera). A bit back I was trying to figure out how to start this project on boot (so that I can plug in my Raspberry Pi and everything works without the need for a desktop). I tried a couple of different things (like adding the command I wanted to the rc.local file, etc.) but ended up adding autoplay to

~/.config/autostart

      

and this is what's inside the file i did:

[Desktop Entry]
Encoding=UTF-8
Name=Terminal autostart
Comment=Start a terminal and boot remote_function.py piped into chdkptp.sh
Exec=/usr/bin/lxterm -e 'cd chdkptp-r735 && ./remote_function.py|./chdkptp.sh'

      

This basically opens up the lxterm and executes the command I need to run my python program, which feeds its output to chdkptp and it works.

But my question is this: I believe I may have accidentally started a Python program elsewhere, trying to figure out what I need to do , because my python program is being loaded twice . I know this because I have an LED flash when the program is up and running, but it blinks twice and I cannot figure out where else I downloaded my program. How do I understand this?

I may already have an answer, but don't know what that means ... I typed this command, suggested by someone:

ps -ax | grep 'remote_function.py'

      

and got this answer:

875 ?        S      0:00 xterm -class UXTerm -title uxterm -u8 -e cd chdkptp-r735 && ./remote_function.py|./chdkptp.sh
1026 pts/0    Ss+    0:00 bash -c cd chdkptp-r735 && ./remote_function.py|./chdkptp.sh
1028 pts/0    S+     0:00 python ./remote_function.py
2169 pts/1    S+     0:00 grep --color=auto remote_function.py

      

This is the answer? If so, what exactly does this mean? Does this have anything to do with the shebang at the beginning of my python program? I am a newbie when it comes to this. If this is not the answer, how do I find where else my program starts at boot?

Shaban this, for reference:

#!/usr/bin/env python

      

+3


source to share


2 answers


[solved]

I understood that.



https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=59285

I was connecting to my raspberry pi with VNC and I had an autorun command along with my remote_python autorun to start the VNC server so that I could remotely connect to my pi without needing a monitor. It turns out there is some kind of bug with the VNC server running things twice. Sure. I use an x11 VNC server instead, and now everything is only loaded once :)

+1


source


Actually you have two processes running your python script.

Finding out what the beginning of the second one might not be very fun, but since you can see that the second one starts with python ./remote_function.py

, then you have two keys:



First, for this ^ to work, it had to be in the same folder as yours remote_function.py

- perhaps you remember re-doing something that started this on its own?

Second, you can find the location of the file that contains this ^ via sudo grep 'python ./remote_function.py' ~

, but since it calls it with ./

- it should be pretty obvious (if you don't have copies of that file scattered about - which might be.

0


source







All Articles