ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a little project on the go, with a LinkSys NSLU2 "Slug" interacting with the outside world via the Velleman K8055 USB interface board. The code is written in C, and runs as a service. And it's all going really well... except that I can't get the code to run properly on startup.
The code resides at /home/dev/test1/roller1 (binary compiled with gcc)
There is a /opt/etc/init.d/S95roller script which starts /home/dev/test1/roller1
Both files are marked executable and belong to owner root and group root.
If I run the code (even from the script) at the command line, all is fine. But it doesn't run properly at boot. Here's the kicker - it DOES RUN, just not well. "ps" shows me that the service has loaded. And the Slug is pretty unresponsive so its obviously busy with SOMETHING. As soon as I stop the service things return to normal.
I've added debug code to write out a text file of progress... but that only works when I run it from the command line too!
The operative word will be the programming thing, I'd say. And
most people here will be very well versed with Linux/Unix, too,
not many Windows-only coders venture here ;}
More info: atop tells me that the program consumes 4% of the CPU when run manually, and the same when run on boot. Don't know if this helps at all. The Slug definately responds .... sluggishly (!) when the program has run at boot, although I can't see what eating the CPU.
This feels very much like a permissions issue... because there's no user on boot? According to the env output above, anyway. Can I force this to run as a user?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.