Search code examples
linuxubuntu-16.04app-startup

How to Save Images from A Program Ran from Ubuntu Application Start-up Command


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.


Solution

  • 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.