Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I created one application for Ubuntu that reads data from serial port and save to a file. But when I run the application that wont work. One permission denied Issue. That is working when I run from terminal using sudo ./AppName an type the password after that.

How I can run and work it without using sudo command.

my requirement is to use it as a daemon by calling it from shell script
Posted
Updated 10-Dec-12 20:28pm
v2
Comments
Eugen Podsypalnikov 11-Dec-12 2:31am    
// my requirement is to use it as a daemon (by calling it from shell script)
That is an answer: your application could communicate with the daemon :)
Arun Kumar K S 11-Dec-12 2:38am    
You mean this will not require sudo and user password for running my application as daemon on ubuntu.
Arun Kumar K S 11-Dec-12 2:42am    
But when I run in terminal it requires sudo and paasword for communicating to serial device
Eugen Podsypalnikov 11-Dec-12 2:55am    
The daemon (in Windows - service) of the HW communication
could be started by the operating system up

and can provide an interface (OpenPort(), ClosePort(), ReadPort(), WritePort(), ..)
for a shell script's (terminal program) calls.

Here we have defined two SW-partners: daemon(1) and shell client program(2).
Richard MacCutchan 11-Dec-12 4:32am    
You should look at why you are getting permission denied (file or serial port?), and try to resolve it by making the object addressable at user level.

1 solution

You can simply give the user the rights needed. Try this:
usermod -a -G dialout MY_USER_NAME

Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900