Xnomad Posted May 12, 2005 Report Share Posted May 12, 2005 Hi, 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] Quote Link to comment Share on other sites More sharing options...
durvish Posted May 12, 2005 Report Share Posted May 12, 2005 write a script and make it executable and put it in .kde/autostart/ Quote Link to comment Share on other sites More sharing options...
watkinb Posted May 12, 2005 Report Share Posted May 12, 2005 (edited) Where should you put it if you want the script to run for all users, especially if it needs to be run as root? /usr/share/autostart? Edited May 12, 2005 by watkinb Quote Link to comment Share on other sites More sharing options...
adamw Posted May 12, 2005 Report Share Posted May 12, 2005 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. Quote Link to comment Share on other sites More sharing options...
ramfree17 Posted May 12, 2005 Report Share Posted May 12, 2005 like i said in another thread, try putting it at the end of /etc/rc.local so it gets executed at every boot. :) ciao! Quote Link to comment Share on other sites More sharing options...
watkinb Posted May 13, 2005 Report Share Posted May 13, 2005 like i said in another thread, try putting it at the end of /etc/rc.local so it gets executed at every boot.<{POST_SNAPBACK}> Sorry I posted it twice. I'm sortof in a hurry to get this part of the project finished. Thanks! Quote Link to comment Share on other sites More sharing options...
Xnomad Posted May 13, 2005 Author Report Share Posted May 13, 2005 (edited) Thank you gentlemen! Edited May 13, 2005 by Xnomad Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.