-2

We're trying to run a program at start with Ubuntu's Application Start-up command. We're successfully starting the camera and viewing the images. But the images are not saving to the folder we expect them to be saved too.

The program works flawlessly when started manually from the terminal. Saving into the appropriate folder.

Does anyone have any idea of how to get the images saved but when started from the Application Start-up command upon start-up?

Thanks.

Sky Walker
  • 23
  • 4
  • 1
    We have no idea what your "a program" is, what its capabilities are, what it does and exactly how it is being run. So it is impossible to answer your question with the current information. Also, unless you are looking for a coding fix question is off-topic as Stackoverflow is for programming questions only. – kaylum Jun 18 '17 at 05:50
  • Please show your code. Since Stack Overflow hides the Close reason from you: *Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve).* – jww Jun 18 '17 at 09:52
  • Thanks, everyone. I'll be sure to add code and make it more specific. Sorry - new to the site. – Sky Walker Jun 19 '17 at 04:46

1 Answers1

0

You're not providing a whole lot of details, so my answer may be totally off. To me it sounds like you've created an app that takes a picture with the webcam and saves it to disk. Now you want the app run it when the user logs in, so you've added your app to the list of Startup Applications. The app starts, takes a picture, but can't write it do disk. If that's the case, I'd consider:

  1. Try adding debug logging to your app, so you can see why it fails opening the file. What ever language this app is written in, if opening a file fails, the API will tell you. This information is vital. The easiest is to print to stdout and then, when starting the app, forward it to a log .e.g. /usr/local/bin/myapp &>> /tmp/myapp.log.
  2. Try writing to a location like /tmp where permissions aren't that much of an issue.
  3. Try adding a delay before starting the app, see this list of various approaches on how to do this, the most simple being using this a the command: sleep 10 ; /usr/local/bin/myapp &>> /tmp/myapp.log

If this is all rubbish you need to add more details in your question.

Stephan Henningsen
  • 3,665
  • 1
  • 22
  • 29
  • Appreciate the help. I'm going to give this a try and review the other suggested options. I'll let you know tomorrow! – Sky Walker Jun 19 '17 at 04:47
  • It was permission issues. I had a file in my home directory a few levels down ... /Home/x/x/y and the folder y, where I wanted to store the images was only offering "Delete and Create" permissions but not "Write and Access" like other files. The images began storing at my home folder. I wonder why this is? Perhaps, I can only change permissions to write and access via chmod command? Curious why this is so. Thanks a ton! – Sky Walker Jun 21 '17 at 15:25