Jump to content

Startup Scripts [Linux]

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
I want to execute several commands automatically when I login. Such as:

Quote

mount /dev/sdb1/ /media/sdb1/

What file do I edit?

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
You should execute mount commands in your fstab (/etc/fstab). By the way you run the mount command without declaring any type of file system I would bet it is already in there. This means you just need to change an option in your fstab.

/dev/hda2 /mnt/fat vfat auto,rw,uid=0,gid=500,showexec,quiet,fmask=117,dmask=007 0 0


The 4th option, which I've bolded in the example above, should be set to "auto" if you want it to mount at boot.


To execute other commands add the commands to your .bashrc file in your home directory.

#3
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
Actually there is nothing about those partitions in fstab.

#4
Guest_Jordan_*

Guest_Jordan_*
  • Guests
Add it then with the "auto" option for #4.

#5
G_Morgan

G_Morgan

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 537 posts
To run a command at start up you put it in the /etc/rc.local file but Jordan is correct and mounting should be done via fstab.