Not able to add program to startup
Made a little c-program i want to start at boot and found out that i can do that through the rc.local script that runs once every time the computer boots. Say that i have a program called test in /home/user/Documents... what do i write rc.local? Know nothing about scripting and i didnt understand what i read when i googled it :/
|
Just add a line to rc.local containing the full path to the program you want to run. For example, if I want to run /home/djshaji/Documents/personal/new/c-programs/bin/hello_world, I would simply put the entire path to the program in rc.local. No need to do any scripting.
|
On Gnome you could type
Code:
gnome-session-properties This works on Gnome 2.30.2, don't know about the newer versions. |
Quote:
|
btw. when i run the script in terminal i get segmentation fault...
|
lol, ill just continue to answer myself so you know where im at. So ive found out that there is no problem with the rc.local script, just that i get segmentation fault. What is this? I can run the applikasjon from window, but not through rc.local
|
Another rc.local problem :/
Okei, i was a bit quick to push the solved button on my other thread so sorry for spamming the forum :P (Really noob;))
My program now starts during the boot through the use of rc.local, but its not still running when i login and check system monitor. My program is essentially an while-loop so it isnt quiting by itself. |
Really you'd have been better to add to the orig qn I think.
Can you point at or describe/summarise the orig qn for me/us? Edit: OK, just stumbled across it. Basically 1. fix the segment violation 2. the entry in rc.local should like something like this Code:
nohup /dir/myprog > /dir/myprog.log 2>&1 & HTH :) http://rute.2038bug.com/index.html.gz |
I merged your two threads and marked the resulting one as "unsolved".
Cheers, Tink |
OP: You've got to give a little more info, man! If you could share the code of your program, or at least to the point where it segfaults, that'd be great. In the meantime:
1. Where is the file to which your application writes "test"? if you fopen() a file that doesn't exist, the function would return a null pointer, and if you mess around with a null pointer, you're bound to get a SEGV 2. Drink Pepsi 3. Use full paths wherever possible in your program. |
SIGSEGV in C is typically caused by overwriting the end of a char 'string' or an array.
A typical gotcha in re (1) is to forget about the '\0' reqd at the end of a string and write a 'normal' char over it, thus removing the EOS (end-of-string) marker that the C string fns rely on. |
All times are GMT -5. The time now is 12:16 PM. |