Jump to content

Have commands run at startup / login? [solved]

Recommended Posts



I'm running Mandriva 10.2 and I was wondering where you can put commands so that they are executed at startup or when you login?


For example I had to turn off dma support as one of my hard disks doesn't work with it.


Now if I want to watch a dvd I have to use


hdparm -d1 /dev/dvd


to enable dma for the dvd player, I have to do this after every reboot.


Where can I add the dparm -d1 /dev/dvd so that I don't have to manually do it all the time.?


[moved from Software by spinynorman]

Link to comment
Share on other sites

Generally speaking, /etc/rc.local.


However, in this case, there's a more elegant MDV solution. Assuming your DVD drive is /dev/hdc - if it's something else, edit the following appropriately - do this. As root:


cd /etc/sysconfig

cp harddisks harddiskhdc

nano harddiskhdc


(or use vim, emacs, whatever floats your boat). It should be fairly obvious what to do, the file is well-commented. Just uncomment the line for enabling DMA.


The files /etc/sysconfig/harddisk* are parsed by the initscripts on boot and used to generate hdparm commands. The settings in the file 'harddisks' will be applied to all hard disks (well, /dev/hd*). If you make a copy of the file named harddiskhda the settings will apply to hda only, a copy named harddiskhdc's settings will apply to hdc only, and so on.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...