PDA

View Full Version : Two things I want to do on startup



Balinsky
20th December 2006, 08:52 PM
Alright just to get it out of the way I am new to linux/fedora

i am trying to get fedora to preform two things at startup

i got my intel pro/wireless 3945 card to work. (which was a pian in the ass) but in order to use it i have to run the load script (i think that loads the daemon, right?) after every time reboot. this would let me prolly die happy

and also i like to run the command:
mount -t cifs //192.168.1.2/XHD /mnt/dave
to mount a windows share. id love if this was automated as well

i assume that there is a configuration file somewhere that can do these things.

any and all help appreciated.
jeBsky

CD-RW
20th December 2006, 08:58 PM
You can start services by adding them into /etc/rc.d/rc.local

You may find this thread on managing services helpful too.

http://forums.fedoraforum.org/forum/showthread.php?t=141887

jim
20th December 2006, 09:55 PM
the share is a fat32 partition?

edit /etc/fstab
add a line like
192.168.1.2:/XHD vfat /mnt/dave user,rw,exec 0 0

ilbh
20th December 2006, 10:00 PM
add your script to /etc/rc.d/rc.local
if you want that script running in only specific runlevels, add that file to your rc.5 folder for example

and for mounting partitions you can add it to /etc/fstab (file system table)
to do that, add one line to fstab like this:
deviceToBeMounted FolderWhereMount FileSystem Configuration
in your case:
//192.168.1.2/XHD /mnt/dave cifs defaults 0 0

when you are auto-mounting devices, search for the official site how to do that,
i search fstab cifs mount on google and i got this site:
http://docs.hp.com/en/B8724-90067/ch02s07.html
there you will see how to do it

Jongi
20th December 2006, 10:11 PM
my cifs section in the fstab



//192.168.1.102/media /mnt/HTPC cifs username=user,password=password,user,rw,noatime 0 0

Where user is the username of the windows user and password the users password.

Balinsky
20th December 2006, 11:57 PM
firstly i never expected replies this fast

@ilbh
when adding my script to /etc/rc.d/rc.local
do i put the word touch in front of it, i dont want to screw anything up

ilbh
21st December 2006, 07:38 AM
just add the file to that folder.

Balinsky
22nd December 2006, 01:25 AM
just add the file to that folder.

forgive me for sounding like a complete retard but /etc/rc.d/rc.local is a script

do i add the load script file to /etc/rc.d/

i really have no idea

ilbh
22nd December 2006, 05:11 AM
you just add it to the runlevel folder where you want it to be able. like rc5.rd
and im not sure, but i think that if you put in rc.d folder, it will be executed on every runlevel startup.
you can place your script there without any worry. if it doesnt work, it wont be a problem.

CD-RW
22nd December 2006, 11:18 AM
do i add the load script file to /etc/rc.d/


/etc/rc.d/rc.local is a simple shell script that is run after all the other services have been started. You can add shell commands here for any services that need to be started once after booting-up the machine. This includes calling other shell scripts to be executed that activate other services, etc.

See http://www.fedorafaq.org/basics/#startonboot

Eg. in /etc/rc.d/rc.local I start my own installations of Apache Web server and MySQL with:

# start Apache web server 2.2.0
/usr/local/apache-2.2.0/bin/apachectl start

# start MySQL 5.0.27
/usr/local/mysql-5.0.27/bin/start-mysql-5.0.27

where start-mysql-5.0.27 is a simple bash shell script I wrote to start mysql with certain command-line parameters.

***

For services that need to be started or stopped depending on the run level you are in, then you need to add symbolic links to the start/stop scripts in /etc/rc.d/init.d, to the rc[1-6].d directories to activate or stop services in the corresponding run levels. This is *detailed* in the previous posting mentioned

http://forums.fedoraforum.org/forum/...ad.php?t=141887

HTH :)