Recommended way to set tape default at boot?

John Buttery johnb+linuxpoweredge at academicsuperstore.com
Tue Apr 24 09:11:44 CDT 2007


* On Tuesday 24 April 2007 08:50, "Zembower, Kevin" 
<kzembowe at jhuccp.org> wrote:
>When I reboot my PE 2450 running Debian etch, the DAT tape drive
>defaults to hardware compression. My backup software, Amanda, prefers
> to do compression itself and needs the tape drive compression off.
> Consequently, I have to remember to do 'ln -s /dev/nst0 /dev/tape &&
> mt datcompression 0' every time I reboot the host. Naturally, I
> forget.
>
>What's the recommended way to execute this command automatically at
>reboot? Is there a hardware or BIOS way to permanently set this?

  I'm guessing you'd be better off with the latter (a permanent setting 
in hardware), but in the interim, here's The Debian Way(tm) to run 
things at startup:

1) Create a shell script to do whatever you want to do, and place it 
in "/etc/init.d".  Make sure it's executable, and that the first 
character of the filename is not a dot ('.') or a hash/number/pound 
sign ('#').  For example, your shell script might be 
called "/etc/init.d/configure_tape_drive".

2) Create a symlink in /etc/rcS.d pointing to your script.  The first 
three characters of the filename must be "Sxx", where 'S' is a literal 
uppercase S and 'xx' is a two-digit number used to make sure the script 
runs in the correct order relative to the other scripts in the 
directory (since they're executed in alphabetical order).  The 
remainder of the filename is arbitrary, but the recommended way is to 
prepend the "Sxx" string to the original filename.  In other words, to 
correspond to the script name above, your symlink might 
be "/etc/rcS.d/S69configure_tape_drive" (again, the 69 is arbitrary and 
you should choose a number that makes the script alphabetize where you 
want it).

  OK, you got me, the actual way to accomplish step 2 is to 
use "update-rc.d" rather than manage the symlink manually.  I generally 
recommend that for arbitrary runlevel management, but for stuff that I 
know for a fact is only going to be in rcS.d due to its nature I 
usually don't bother.

-- 
John Buttery <johnb at academicsuperstore.com>
System Administrator



More information about the Linux-PowerEdge mailing list