Couple of Linux Questions

MDE

Lifer
Jul 17, 2003
13,199
1
81
I just installed Fedora Core 3 (x86-64) on my eMachines M6805 tonight and it's gone smoothly. I have a couple of quick questions though...

1) How do I start a program with the OS? Specifically Folding@Home (located in /home/bill/Folding@Home/FAH502-Linux.exe).

2) How do I add Windows XP to the bootloader menu? I partitioned with Partition Magic, putting the Linux partition at the end of the drive.
 

qbek

Member
Mar 12, 2005
110
0
0
1) Edited: In the terminal change the directory and type: "./FAH5-Linux.exe". I assume you have execute privilege. If not then you need to change them (as root, type "chmod +x FAH5-Linux.exe").
2) Do you use LILO or GRUB?
 

MDE

Lifer
Jul 17, 2003
13,199
1
81
1) I know how to start it but I want it to automatically start when the system boots.
2) Whatever Fedora\Red Hat defaults to. EDIT: GRUB

I'm assuming that for #1 I'll have to write a script of some sort.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
1) I know how to start it but I want it to automatically start when the system boots.

Generally whe I do is take /etc/init.d/skeleton and edit it, put in the info related to the 'service' I'm creating and then set it to run for whatever my default runlevel is. RH makes this a little harder since they don't provide a skeleton, though.

 

drag

Elite Member
Jul 4, 2002
8,708
0
0

Linux uses a init.. Init is the first program that starts it starts all the other programs that setup and run your OS. It's behavor is controlled thru 'runlevels' and 'init scripts'.

A paticular runlevel tells the OS what scripts to run.. runlevel 1 and runlevel S are the first runlevels and they setup your hardware and basic stuff (called single user mode, also). Runlevel 5 is the default runlevel and it is for normal usage, Runlevel 3 is usefull as it's almost like runlevel 5, but without the graphical login... Usefull for when you need to install nvidia's propriatory drivers (use the command 'telinit 3' from the console). Runlevel 0 is for 'halt' or shutdown, and runlevel 6 is for reboot.

So if you want to a program to start up at bootup time you'd have to edit or create a init script.

Redhat/Fedora provides a /etc/rc.local file to do that. Any command you put in their will be ran at bootup time after every other startup task has been completeled.

Also you can use the 'nice' command to assign a priority to a program. The higher the priority, or the 'less nice' it gets, the more time and resources are assigned to it. The lower the priority, or the 'more nice' it gets, the less time and resources it gets.

Think about it in the way that a 'nice guy' will let other people in line in front of him, while a unnice guy will bully people for their stuff.

So that way you can run the command at boot, and assign a low priority so that it won't hog the resources as you use your desktop or run other commands. So you can set it to run in the background pretty much and only use the CPU when other programs don't need it. You may need to try different 'niceness' levels to get the best performance, though.


So in /etc/rc.local file you put:

echo 'starting folding@home'
nice -n 15 /home/bill/Folding@Home/FAH502-Linux.exe
(the numbers range from 20 for very nice to -19 for very not nice)

Although you may want to copy the file to /usr/local/bin/ for convienience sake.

the rc.local may be in /etc/rc.d/ instead of just /etc, but I think I got it right.



for the grub thing try adding this to your /boot/grub/menu.lst or /etc/grub.conf or something like that file:
title Windows XP
rootnoverify (hd0,0)
makeactive
chainloader +1

were (hd0,0) matches the harddrive number and partition number. Grub (like a programmer) starts counting at zero, so 0 = the first drive, 1 = the second drive, and so on and so forth.

All you have to do is edit the file and it should show up by default. Grub reads that file each time it boots up. Also whenever editing config files make a copy of the original incase you make a typo. Then if you mess it up (happens to everybody) then you can just copy back the original.

Although this should of been setup by default for Fedora...
 

MDE

Lifer
Jul 17, 2003
13,199
1
81
If I want Folding@Home to start in the background, where would I would put in the &? I'm assuming it would go before /home/bill/Fol.... but I want to make sure. I can now get Windows to boot but it bluescreens before I get any kind of GUI at all, I'm assuming it's just a Windows problem but I just want to get Fedora up and running right now.