Autostart application at boot time

Ask questions regarding Gentoox, Gentoo and Linux in general in these forums and we'll do our best to help you!
Post Reply
trixter
Adept
Posts: 65
Joined: Thu Sep 25, 2003 7:25 pm

Autostart application at boot time

Post by trixter »

How do I autostart an application when gentoox boots? I have a working application (camsource) which must be run as root. I it works fine when I start it from a kounsel or when I use putty to ssh into the xbox. I tried doing:

"rc-update add camsource default"

but that says file can't be found.

Then I tried adding it to the "/etc/conf.d/local.start" file as either just "camsource" or "/usr/bin/camsource", but neither of these works.

Since I can start it manually as root using putty, there must be a way to make it start automatically at boot time. Can anyone tell me how? Thanks.
rocketeer
Pro
Posts: 75
Joined: Sun Aug 17, 2003 12:05 am

Post by rocketeer »

"rc-update add camsource default"
If I'm not mistaken, I believe this looks for a file named "camsource" in /etc/init.d/ upon startup.
THat's where all the start/stop scripts are stored.
fuz
Power user
Posts: 228
Joined: Wed Oct 22, 2003 6:03 am
Location: sunshine coast, Australia
Contact:

Post by fuz »

what is the command line that you type to start the app after you have booted..

by rights if you add that to the local.start that will work..

have you tried this? can you give me more information please :)
127.0.0.1, wherever you go.. there you are!
trixter
Adept
Posts: 65
Joined: Thu Sep 25, 2003 7:25 pm

Post by trixter »

Once gentoox boots up I simply login as "root" and then type "camsource" from the # prompt. Camsource then starts up just fine with no errors. When I add the same "camsource" to the local.start file and let the system boot it gives me an error (file not found I seem to recall). Could the problem be that camsource must be run from root? How do you add something to local.start with root privileges? Keep in mind that camsource is for a webcam so usb services need to be up and running, but I would think that usb would be running before local.start runs.
JusKickNit
Novice
Posts: 27
Joined: Wed Oct 15, 2003 2:41 am

Post by JusKickNit »

Try "/usr/bin/camsource" or "exec /usr/bin/camsource" in /etc/conf.d/local.start if that dosn't work I know you can add
"exec /usr/bin/camsource" Too /etc/profile although I don't know how safe the latter is. Of course no quotes.
fuz
Power user
Posts: 228
Joined: Wed Oct 22, 2003 6:03 am
Location: sunshine coast, Australia
Contact:

Post by fuz »

what is camsource?

i could be that it needs to have everything initialised before it can run or it may be a permissions problem..

tell me what camsource is and then i can help
127.0.0.1, wherever you go.. there you are!
trixter
Adept
Posts: 65
Joined: Thu Sep 25, 2003 7:25 pm

Post by trixter »

Camsource is a webcam program that can do a lot of things. I use it to grab a new image every 15 seconds and write that image to a jpeg file on the xbox hard drive. Apache2 is then used with my web page to serve the image. It all works great, if camsource is started manually from root after gentoox fully boots up (just log in as root and type "camsource", no quotes, at the hash prompt).

Camsource loads pwc which is part of the linux kernel. It also loads pwcx which is a driver helper that I emerged. You can read more about camsource here:
http://camsource.sourceforge.net/

pwc and pwcx are discussed here: http://www.smcc.demon.nl/webcam/release.html

Here is the message that camsource writes to the screen when it successfully starts up:
Camsource 0.7.0 starting up...
Loading modules:
input_v4l (alias input_v4l) version 0.7.0 OK
jpeg_comp (alias jpeg_comp) version 0.7.0 OK
socket (alias socket) version 0.7.0 OK
wc_serv (alias wc_serv) version 0.7.0 OK
wc_serv (alias noresizewc) version 0.7.0 OK
http (alias http) version 0.7.0 OK
filewrite (alias filewrite) version 0.7.0 OK
resize (alias resize) version 0.7.0 OK
text (alias text) version 0.7.0 OK
Main init done and logfile opened.
Closing stdout and going into background...

I hope this gives you the information you need. Thanks.
fuz
Power user
Posts: 228
Joined: Wed Oct 22, 2003 6:03 am
Location: sunshine coast, Australia
Contact:

Post by fuz »

based on the assumption that its the last thing to load and its console based the only reasoning i can see for the error is permissions try and "su" as root instead of gentooX at start and see if that makes any difference.. providing that its not trying to use un-initialised modules/devs it should run fine at start

else

get used to typing camsource after booting :P

try the first option first
127.0.0.1, wherever you go.. there you are!
Post Reply