Amanda-Users

Re: can only run amanda tests as root

2006-08-04 07:36:14
Subject: Re: can only run amanda tests as root
From: Gene Heskett <gene.heskett AT verizon DOT net>
To: amanda-users AT amanda DOT org
Date: Fri, 04 Aug 2006 07:30:07 -0400
On Friday 04 August 2006 05:24, Paul Bijnens wrote:
>On 2006-08-04 10:31, Stephen Carter wrote:
>> I installed Amanda via rpm and it's been around in SuSE for a long
>> time, so I would expect someone to have picked up this 'basic'
>> problem and fixed it since SuSE 9.3 up to SLES 10 if it were an
>> amanda compile / install issue (I tried this on SuSE 9.3, 10, 10.1,
>> SLES9 & 10). The permissions are correct for the amanda user, and
>> amanda's default group is the disk group.
>>
>> The problem is that the disk group has, by default, only read access
>> to changer devices (/dev/sg*) in SuSE that are created dynamically
>> during boot. The perms assigned are governed by rules in udev, which
>> I pointed out.
>>
>> For what it's worth, all no changer tape devices (e.g. /dev/nst*) do
>> give the disk group read and write perms by default so no problem
>> there... it's only an issue if you are using a changer with SuSE (or
>> CentOS apparently)
>
>CentOS???
>
>I run CentOS 4.3, and in my /etc/udev/permissions.d/50-udev.permissions
>I find:
>
>  [...]
>  # disk devices
>  hd*:root:disk:0660
>  sd*:root:disk:0660
>  [...]
>  # tape devices
>  [...]
>  st*:root:disk:0660
>  nst*:root:disk:0660
>  [...]
>  # scsi devices
>  sg*:root:disk:0660
>
>
>So, all seems fine here.

This is not the same format as is contained in this file on my FC5 lappy, 
but in all cases of a changer or a scanner assigned to a /dev/sg#, the 
perms assigned appear to be root:disk and 0660.  From that file:
=======================
# sd:           0 TYPE_DISK, 7 TYPE_MOD, 14 TYPE_RBC
# sr:           4 TYPE_WORM, 5 TYPE_ROM
# st/osst:      1 TYPE_TAPE
# sg:           8 changer, [36] scanner
ACTION=="add", SUBSYSTEM="scsi" , SYSFS{type}=="0|7|14", \
        RUN+="/bin/sh -c 'echo 60 > /sys$$DEVPATH/timeout'"
ACTION=="add", SUBSYSTEM="scsi" , SYSFS{type}=="1", \
        RUN+="/bin/sh -c 'echo 900 > /sys$$DEVPATH/timeout'"


ACTION=="add", SUBSYSTEM=="scsi_device" RUN+="/sbin/modprobe sg"
ACTION=="add", SUBSYSTEM=="scsi_device", SYSFS{type}=="0|7|14", \
        RUN+="/sbin/modprobe sd_mod"
ACTION=="add", SUBSYSTEM=="scsi_device", SYSFS{type}=="[45]", \
        RUN+="/sbin/modprobe sr_mod"

ACTION=="add", KERNEL=="sg[0-9]*", BUS=="scsi", SYSFS{type}=="[36]", \
        SYMLINK+="scanner scanner-%k", MODE="0660"

ACTION=="add", KERNEL=="sg[0-9]*", BUS=="scsi", SYSFS{type}=="8", \
        SYMLINK+="changer changer-%k", MODE="0660", GROUP="disk"

ACTION=="add", SUBSYSTEM=="scsi_device", SYSFS{type}=="1", 
SYSFS{device/vendor}=="On[sS]tream", \
        SYSFS{model}!="ADR*", RUN+="/sbin/modprobe osst"
ACTION=="add", SUBSYSTEM=="scsi_device", SYSFS{type}=="1", 
SYSFS{device/vendor}=="On[sS]tream", \
        SYSFS{model}=="ADR*", RUN+="/sbin/modprobe st"
ACTION=="add", SUBSYSTEM=="scsi_device", SYSFS{type}=="1", 
SYSFS{device/vendor}!="On[sS]tream", \
        RUN+="/sbin/modprobe st"
=========================
I have no idea if this is correct as there's no changer, not even any scsi 
stuff on this lappy, but you can compare and fix the obvious stuff at 
least. And file a bugzilla entry if you get it fixed, giving details.

-- 
Cheers, Gene
People having trouble with vz bouncing email to me should add the word
'online' between the 'verizon', and the dot which bypasses vz's
stupid bounce rules.  I do use spamassassin too. :-)
Yahoo.com and AOL/TW attorneys please note, additions to the above
message by Gene Heskett are:
Copyright 2006 by Maurice Eugene Heskett, all rights reserved.