2

I wrote a python script and added it to the list of startup applications in Ubuntu. After restarting the device I can find that the script has not run and I don't know where to find the logs. What is the default location in which the logs will be stored?

I searched around similar questions such as this.I don't think this will apply for me as I am using a different method than the one mentioned in the question.

EDIT : I did not add my script in rc.local or as a cron job. In ubuntu dash if you type startup you will get a window asking you to add commands that you want to execute on startup. I added my script in that window.

Nirmal Raj
  • 181
  • 1
  • 1
  • 7

1 Answers1

2

After you added your python script to startup applications, a new '.desktop' file - corresponding to your script - have appeared in ~/.config/autostart That file contains a line saying: Exec=your_script.py

A simple workaround would be to change in the .desktop file your_script.py to wrapper.sh, where wrapper.sh would be a new script simply reading: python your_script.py > your_log.txt

Then, obviously, the output of your_script.py will appear in your_log.txt.

P.S. I would have added this workaround as a comment rather, than a solution, which I cannot do as a newly registered user. Sorry about that, hope it helps.

Maciek
  • 141