autoexec.bat?
Hi Folks,
I need to get the file info which corresponds to something like the “autoexec.bat” in dos. I’ve got these 3 commands to put at startup and i don’t know where to put them.
I tried digging into the manuals myself too and found some info regarding a file lilo.conf that run at startup, placed in the /etc dir; but adding these commands here doesn’t work.
BTW the command i wanted to add at startup are:
mount /dev/hda1 –t vfat /mnt/c
mount /dev/hda5 –t vfat /mnt/d
/usr/local/apache/bin apachectl start
One thing more, i’d partitioned my hardisk at the very beginning into a primary and extended dos partition (before using fips) making two drives on my system called ‘c:’ and ‘e:’. Now mount command for ‘e:’ should be something similar like “mount /dev/hda6 –t vfat /mnt/e” but i’m unable to run it...?
cyanide.
[size="1"]----#!/usr/bin/perlprint length "The answer to life,universe and everything";
There is an autoexec.bat like system in Linux, it's found under the /etc/rc.d directory. You should be able to find some information for that at any General Linux Infomation site (Linux Documentation Project is the best bet). For Apache that's exactly what you want to do. The simplest solution without getting into everything is to put the "/usr/local/apache/bin/apachectl start" command in the /etc/rc.d/rc.local shell script. But go read up on the /etc/rc.d and you will get a better understanding of Linux bootups and how the Apache Service should really be started up.
However, /etc/rc.d is not the best way to handle your situation with respect to the hard drives. For the drives, check out /etc/fstab file. This is a file specifying the filesystems table for your system. Here you should just add a couple lines like:
/dev/hda1 /mnt/c vfat defaults 0 0
/dev/hda5 /mnt/d vfat defaults 0 0
(This is all from memory, check out the man page on fstab and you'll get a complete description of how the flags should be set.)
Then everytime you boot your system, the drives will be mounted.
As for the problem with the extended partition, I'm just guessing here, but try adding some logical partitions to the extended partition via fdisk and mount those. That should work.
- Synchronized
Edited by - Synchronized on January 10, 2001 5:18:01 AM
However, /etc/rc.d is not the best way to handle your situation with respect to the hard drives. For the drives, check out /etc/fstab file. This is a file specifying the filesystems table for your system. Here you should just add a couple lines like:
/dev/hda1 /mnt/c vfat defaults 0 0
/dev/hda5 /mnt/d vfat defaults 0 0
(This is all from memory, check out the man page on fstab and you'll get a complete description of how the flags should be set.)
Then everytime you boot your system, the drives will be mounted.
As for the problem with the extended partition, I'm just guessing here, but try adding some logical partitions to the extended partition via fdisk and mount those. That should work.
- Synchronized
Edited by - Synchronized on January 10, 2001 5:18:01 AM
thanks Synchronized ![](smile.gif)
Will try it as soon as i load linux again.
maybe i''ll backup my extended partion and create a new dos partition instead (via FIPS) to solve the second problem.
cyanide.
![](smile.gif)
Will try it as soon as i load linux again.
maybe i''ll backup my extended partion and create a new dos partition instead (via FIPS) to solve the second problem.
cyanide.
[size="1"]----#!/usr/bin/perlprint length "The answer to life,universe and everything";
If you don''t find the init scripts under /etc/rc.d look somewhere else... SuSE p.ex. stores these files under /etc/init.d. I''m a little rusty when it comes to the FS standard, but I think the /etc/rc.d should help, tho. A method for finding it
Have fun... (oops, is this copyrighted???
)
Have fun... (oops, is this copyrighted???
![](tongue.gif)
February 01, 2001 08:52 AM
if you have created a logical partition inside the extended partition (I assume you have, since you say that it shows up in DOS as e
, then that should be /dev/hda5 if it is the first logical partition within the extended partition (/dev/hda6 if it is the second etc)
![](smile.gif)
aha thanks for replying, but its too late.
Its been long after i totally did mess up all my 10GB hdd. So i was forced to create everything from scratch and now i''ve put my redhat 6 back, though it ain''t that butt kicking like Suse but still i think i''m better off with my first linux![](wink.gif)
cyanide.
Its been long after i totally did mess up all my 10GB hdd. So i was forced to create everything from scratch and now i''ve put my redhat 6 back, though it ain''t that butt kicking like Suse but still i think i''m better off with my first linux
![](wink.gif)
cyanide.
[size="1"]----#!/usr/bin/perlprint length "The answer to life,universe and everything";
February 14, 2001 10:02 AM
> There is an autoexec.bat like system in Linux, it''s found under the /etc/rc.d directory
Eeeek!
remember linux is mutiuser!
better put the lines you want to add in .bashrc in your home directory (if you''re using bash (which you probably are))
Eeeek!
remember linux is mutiuser!
better put the lines you want to add in .bashrc in your home directory (if you''re using bash (which you probably are))
Depends. If you want to activate stuff system wide for all (potential) users, then it''s be better to do it in the init scripts. Mounting filesyystems should be done via the /ets/fstab file since trying to mount fs''s severaltimes results in ugly error messages. Plus, depending on how X is configured, each xterm is treated as a login session and trys to mount, so that''s not a very clean solution.
Personally, I haven''t yet found much use for .profile other than some aliases and variable settings.
Personally, I haven''t yet found much use for .profile other than some aliases and variable settings.
Sorry; just browsing through old posts....
Aye; it wouldn''t be good to put it into the .bashrc because it would attempt to mount each hard drive tons of times; each time you logged in, each time you started X (or Gnome, KDE, etc), and each time you opened a new terminal; you only need them to be mounted once, and unless apache dies every couple of minutes, you''re going to only want to start it once... I''d modify /etc/init.d to create a respawning deamon for runlevels 2 and 4 for apachectl....I don''t remember the exact lines now, but it isn''t hard to get the hang of.
(o= erydo =o)
Aye; it wouldn''t be good to put it into the .bashrc because it would attempt to mount each hard drive tons of times; each time you logged in, each time you started X (or Gnome, KDE, etc), and each time you opened a new terminal; you only need them to be mounted once, and unless apache dies every couple of minutes, you''re going to only want to start it once... I''d modify /etc/init.d to create a respawning deamon for runlevels 2 and 4 for apachectl....I don''t remember the exact lines now, but it isn''t hard to get the hang of.
(o= erydo =o)
[email=erydo@gdnmail.net" style="color: #ff0000; text-decoration:none; cursor:help;](o= erydo =o)[/email]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement