public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] CDRW permissions and devfsd
@ 2002-08-25 20:55 Yrjö Hatakka
  2002-08-27  0:00 ` Burton Samograd
  2002-08-27 13:23 ` Stuart Bouyer
  0 siblings, 2 replies; 15+ messages in thread
From: Yrjö Hatakka @ 2002-08-25 20:55 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have this entry in my devfsd.conf:
REGISTER        ^sg0$       PERMISSIONS root.cdrw 660

but after boot, permissions of that device are:
crw-r-----    1 root     root      21,   0 Jan  1  1970 generic

when I do : "kill -HUP `pidof devfsd`, I get:
 crw-rw----    1 root     cdrw      21,   0 Jan  1  1970 generic

So question is: Why does devfsd fails to set right permissions at boot time?

- -- 
Linux cartman.linux.home 2.4.19-gentoo-r7 #1 Fri Jul 5 00:45:50 EEST 2002 i686 
AuthenticAMD 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9aURi6BYkNNMD2uARAlcRAJ9IfAwclcUblFIitV61BSSwuAcCgwCgsRbt
L4h5rsvsSOchkopOjKaKeiY=
=+AsC
-----END PGP SIGNATURE-----




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [gentoo-dev] CDRW permissions and devfsd
  2002-08-25 20:55 [gentoo-dev] CDRW permissions and devfsd Yrjö Hatakka
@ 2002-08-27  0:00 ` Burton Samograd
  2002-08-27  7:48   ` Yrjö Hatakka
  2002-08-27 13:23 ` Stuart Bouyer
  1 sibling, 1 reply; 15+ messages in thread
From: Burton Samograd @ 2002-08-27  0:00 UTC (permalink / raw
  To: gentoo-dev

I also noticed this behaviour when trying to set permissions on a
device.  Maybe it has to do with setting the "enable devfs at boot"
flag in the kernel compile settings?  

burton

On Sun, Aug 25, 2002 at 08:55:50PM +0000, Yrj? Hatakka wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> I have this entry in my devfsd.conf:
> REGISTER        ^sg0$       PERMISSIONS root.cdrw 660
> 
> but after boot, permissions of that device are:
> crw-r-----    1 root     root      21,   0 Jan  1  1970 generic
> 
> when I do : "kill -HUP `pidof devfsd`, I get:
>  crw-rw----    1 root     cdrw      21,   0 Jan  1  1970 generic
> 
> So question is: Why does devfsd fails to set right permissions at boot time?
> 
> - -- 
> Linux cartman.linux.home 2.4.19-gentoo-r7 #1 Fri Jul 5 00:45:50 EEST 2002 i686 
> AuthenticAMD 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.7 (GNU/Linux)
> 
> iD8DBQE9aURi6BYkNNMD2uARAlcRAJ9IfAwclcUblFIitV61BSSwuAcCgwCgsRbt
> L4h5rsvsSOchkopOjKaKeiY=
> =+AsC
> -----END PGP SIGNATURE-----
> 
> 
> _______________________________________________
> gentoo-dev mailing list
> gentoo-dev@gentoo.org
> http://lists.gentoo.org/mailman/listinfo/gentoo-dev


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [gentoo-dev] CDRW permissions and devfsd
  2002-08-27  7:48   ` Yrjö Hatakka
@ 2002-08-27  5:22     ` Burton Samograd
  0 siblings, 0 replies; 15+ messages in thread
From: Burton Samograd @ 2002-08-27  5:22 UTC (permalink / raw
  To: gentoo-dev

Well, I just tried my own suggestion and...it doesn't seem to work.  I
don't really know what else to do other than to write a little command
to do a SIGHUP at startup (maybe in local.start) or something.  Or
there could be a real solution that someone else knows and they might
care to share with us? ;-)

burton

On Tue, Aug 27, 2002 at 07:48:29AM +0000, Yrj? Hatakka wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Tuesday 27 August 2002 00:00, Burton Samograd wrote:
> > I also noticed this behaviour when trying to set permissions on a
> > device.  Maybe it has to do with setting the "enable devfs at boot"
> > flag in the kernel compile settings?
> 
> Hmm, so shoud that flag be disabled and let boot scripts do the enabling dvfsd 
> ? 
> 
> - -- 
> Linux cartman.linux.home 2.4.19-gentoo-r7 #1 Fri Jul 5 00:45:50 EEST 2002 i686 
> AuthenticAMD 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.7 (GNU/Linux)
> 
> iD8DBQE9ay7U6BYkNNMD2uARAmCPAJ9U+e5fIN4B9W33CT3fEqdLCfx3rQCfea4A
> QpGyJF5x4ylB0zn3VBSFJKE=
> =bM0m
> -----END PGP SIGNATURE-----
> 
> 
> _______________________________________________
> gentoo-dev mailing list
> gentoo-dev@gentoo.org
> http://lists.gentoo.org/mailman/listinfo/gentoo-dev


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [gentoo-dev] CDRW permissions and devfsd
  2002-08-27  0:00 ` Burton Samograd
@ 2002-08-27  7:48   ` Yrjö Hatakka
  2002-08-27  5:22     ` Burton Samograd
  0 siblings, 1 reply; 15+ messages in thread
From: Yrjö Hatakka @ 2002-08-27  7:48 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 27 August 2002 00:00, Burton Samograd wrote:
> I also noticed this behaviour when trying to set permissions on a
> device.  Maybe it has to do with setting the "enable devfs at boot"
> flag in the kernel compile settings?

Hmm, so shoud that flag be disabled and let boot scripts do the enabling dvfsd 
? 

- -- 
Linux cartman.linux.home 2.4.19-gentoo-r7 #1 Fri Jul 5 00:45:50 EEST 2002 i686 
AuthenticAMD 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9ay7U6BYkNNMD2uARAmCPAJ9U+e5fIN4B9W33CT3fEqdLCfx3rQCfea4A
QpGyJF5x4ylB0zn3VBSFJKE=
=bM0m
-----END PGP SIGNATURE-----




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [gentoo-dev] CDRW permissions and devfsd
  2002-08-25 20:55 [gentoo-dev] CDRW permissions and devfsd Yrjö Hatakka
  2002-08-27  0:00 ` Burton Samograd
@ 2002-08-27 13:23 ` Stuart Bouyer
  2002-08-27 22:39   ` Yrjö Hatakka
  1 sibling, 1 reply; 15+ messages in thread
From: Stuart Bouyer @ 2002-08-27 13:23 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1319 bytes --]

On 月, 2002-08-26 at 05:55, Yrjö Hatakka wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> I have this entry in my devfsd.conf:
> REGISTER        ^sg0$       PERMISSIONS root.cdrw 660

add this line to devfsd.conf

REGISTER        ^sr0$       PERMISSIONS root.cdrw 660

I think you'll find that the cdrw is a scsi scdrom rather than a scsi
generic device.

stu@gentoo-bear etc $ ls -l /dev/cdrw
lr-xr-xr-x    1 root     root            3 2002-08-28  /dev/cdrw -> sr0

 
> but after boot, permissions of that device are:
> crw-r-----    1 root     root      21,   0 Jan  1  1970 generic
> 
> when I do : "kill -HUP `pidof devfsd`, I get:
>  crw-rw----    1 root     cdrw      21,   0 Jan  1  1970 generic
> 
> So question is: Why does devfsd fails to set right permissions at boot time?
> 
> - -- 
> Linux cartman.linux.home 2.4.19-gentoo-r7 #1 Fri Jul 5 00:45:50 EEST 2002 i686 
> AuthenticAMD 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.7 (GNU/Linux)
> 
> iD8DBQE9aURi6BYkNNMD2uARAlcRAJ9IfAwclcUblFIitV61BSSwuAcCgwCgsRbt
> L4h5rsvsSOchkopOjKaKeiY=
> =+AsC
> -----END PGP SIGNATURE-----
> 
> 
> _______________________________________________
> gentoo-dev mailing list
> gentoo-dev@gentoo.org
> http://lists.gentoo.org/mailman/listinfo/gentoo-dev
-- 

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [gentoo-dev] CDRW permissions and devfsd
  2002-08-27 13:23 ` Stuart Bouyer
@ 2002-08-27 22:39   ` Yrjö Hatakka
  2002-08-28  2:09     ` Stuart Bouyer
  0 siblings, 1 reply; 15+ messages in thread
From: Yrjö Hatakka @ 2002-08-27 22:39 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 27 August 2002 13:23, Stuart Bouyer wrote:

> add this line to devfsd.conf
>
> REGISTER        ^sr0$       PERMISSIONS root.cdrw 660
>

Nope no avail besides cdrecord wants sg0

yrjo_h@cartman yrjo_h $ cdrecord dev=/dev/sr0 -scanbus
Cdrecord 1.11a30 (i686-pc-linux-gnu) Copyright (C) 1995-2002 Jörg Schilling
scsidev: '/dev/sr0'
devname: '/dev/sr0'
scsibus: -2 target: -2 lun: -2
cdrecord: Read-only file system. Cannot open '/dev/sr0'. Cannot open SCSI 
driver.
cdrecord: For possible targets try 'cdrecord -scanbus'. Make sure you are 
root.


> I think you'll find that the cdrw is a scsi scdrom rather than a scsi
> generic device.
>
> stu@gentoo-bear etc $ ls -l /dev/cdrw
> lr-xr-xr-x    1 root     root            3 2002-08-28  /dev/cdrw -> sr0
>

yrjo_h@cartman yrjo_h $ l /dev/cdrw
lr-xr-xr-x    1 root     root            3 Aug 27 22:31 /dev/cdrw -> sg0
yrjo_h@cartman yrjo_h $ l /dev/sg0
lr-xr-xr-x    1 root     root           36 Aug 27 22:31 /dev/sg0 -> 
scsi/host0/bus0/target0/lun0/generic
yrjo_h@cartman yrjo_h $ l /dev/scsi/host0/bus0/target0/lun0/generic
crw-r-----    1 root     root      21,   0 Jan  1  1970 
/dev/scsi/host0/bus0/target0/lun0/generic

cartman root # kill -HUP `pidof devfsd`
cartman root # l /dev/sg0
lr-xr-xr-x    1 root     root           36 Aug 27 22:31 /dev/sg0 -> 
scsi/host0/bus0/target0/lun0/generic
cartman root # l /dev/scsi/host0/bus0/target0/lun0/generic
crw-rw----    1 root     cdrw      21,   0 Jan  1  1970 
/dev/scsi/host0/bus0/target0/lun0/generic
cartman root #

What to next ?, I'm out of ides

- -- 
Linux cartman.linux.home 2.4.19-gentoo-r7 #1 Fri Jul 5 00:45:50 EEST 2002 i686 
AuthenticAMD 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9a/+76BYkNNMD2uARAqo7AJ91CoPy8KSa+dPEZOjL3D0LRXBJSACeNUB7
YivlNIPG/36lLb/TYQLKZ5Y=
=XeQK
-----END PGP SIGNATURE-----




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [gentoo-dev] CDRW permissions and devfsd
  2002-08-27 22:39   ` Yrjö Hatakka
@ 2002-08-28  2:09     ` Stuart Bouyer
  2002-08-28  7:19       ` Yrjö Hatakka
  0 siblings, 1 reply; 15+ messages in thread
From: Stuart Bouyer @ 2002-08-28  2:09 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 2553 bytes --]

On 水, 2002-08-28 at 07:39, Yrjö Hatakka wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Tuesday 27 August 2002 13:23, Stuart Bouyer wrote:
> 
> > add this line to devfsd.conf
> >
> > REGISTER        ^sr0$       PERMISSIONS root.cdrw 660
> >
> 
> Nope no avail besides cdrecord wants sg0
> 
> yrjo_h@cartman yrjo_h $ cdrecord dev=/dev/sr0 -scanbus
> Cdrecord 1.11a30 (i686-pc-linux-gnu) Copyright (C) 1995-2002 Jörg Schilling
> scsidev: '/dev/sr0'
> devname: '/dev/sr0'
> scsibus: -2 target: -2 lun: -2
> cdrecord: Read-only file system. Cannot open '/dev/sr0'. Cannot open SCSI 
> driver.
> cdrecord: For possible targets try 'cdrecord -scanbus'. Make sure you are 
> root.
> 
> 
> > I think you'll find that the cdrw is a scsi scdrom rather than a scsi
> > generic device.
> >
> > stu@gentoo-bear etc $ ls -l /dev/cdrw
> > lr-xr-xr-x    1 root     root            3 2002-08-28  /dev/cdrw -> sr0
> >
> 
> yrjo_h@cartman yrjo_h $ l /dev/cdrw
> lr-xr-xr-x    1 root     root            3 Aug 27 22:31 /dev/cdrw -> sg0
> yrjo_h@cartman yrjo_h $ l /dev/sg0
> lr-xr-xr-x    1 root     root           36 Aug 27 22:31 /dev/sg0 -> 
> scsi/host0/bus0/target0/lun0/generic
> yrjo_h@cartman yrjo_h $ l /dev/scsi/host0/bus0/target0/lun0/generic
> crw-r-----    1 root     root      21,   0 Jan  1  1970 
> /dev/scsi/host0/bus0/target0/lun0/generic
> 
> cartman root # kill -HUP `pidof devfsd`
> cartman root # l /dev/sg0
> lr-xr-xr-x    1 root     root           36 Aug 27 22:31 /dev/sg0 -> 
> scsi/host0/bus0/target0/lun0/generic
> cartman root # l /dev/scsi/host0/bus0/target0/lun0/generic
> crw-rw----    1 root     cdrw      21,   0 Jan  1  1970 
> /dev/scsi/host0/bus0/target0/lun0/generic
> cartman root #
> 
> What to next ?, I'm out of ides
> 

Do you have scsi-cdrom support in the kernel or as a module? Otherwise
as normal user I can't use cdrecord as it looks for sg0.

from my kernel .config
#
# SCSI support
#
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
CONFIG_SD_EXTRA_DEVS=40
# CONFIG_CHR_DEV_ST is not set
# CONFIG_CHR_DEV_OSST is not set
CONFIG_BLK_DEV_SR=y
CONFIG_BLK_DEV_SR_VENDOR=y
CONFIG_SR_EXTRA_DEVS=2
CONFIG_CHR_DEV_SG=y
CONFIG_SCSI_DEBUG_QUEUES=y
CONFIG_SCSI_MULTI_LUN=y
CONFIG_SCSI_CONSTANTS=y
# CONFIG_SCSI_LOGGING is not set

Another thing to try is check in /lib/dev-state, where devfsd keeps all
its permissions and make sure that it isn't being set there. Not sure
why it changes after a SIGHUP, but not a boot time though

Stuart Bouyer




[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [gentoo-dev] CDRW permissions and devfsd
  2002-08-28  2:09     ` Stuart Bouyer
@ 2002-08-28  7:19       ` Yrjö Hatakka
       [not found]         ` <200208310307.36201.bauno@inwind.it>
  0 siblings, 1 reply; 15+ messages in thread
From: Yrjö Hatakka @ 2002-08-28  7:19 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 28 August 2002 02:09, Stuart Bouyer wrote:

> Do you have scsi-cdrom support in the kernel or as a module? Otherwise
> as normal user I can't use cdrecord as it looks for sg0.
>
> from my kernel .config
> #
> # SCSI support
> #
> CONFIG_SCSI=y
> CONFIG_BLK_DEV_SD=y
> CONFIG_SD_EXTRA_DEVS=40
> # CONFIG_CHR_DEV_ST is not set
> # CONFIG_CHR_DEV_OSST is not set
> CONFIG_BLK_DEV_SR=y
> CONFIG_BLK_DEV_SR_VENDOR=y
> CONFIG_SR_EXTRA_DEVS=2
> CONFIG_CHR_DEV_SG=y
> CONFIG_SCSI_DEBUG_QUEUES=y
> CONFIG_SCSI_MULTI_LUN=y
> CONFIG_SCSI_CONSTANTS=y
> # CONFIG_SCSI_LOGGING is not set
>
> Another thing to try is check in /lib/dev-state, where devfsd keeps all
> its permissions and make sure that it isn't being set there. Not sure
> why it changes after a SIGHUP, but not a boot time though

Plot thickens

I have it as a module:
CONFIG_BLK_DEV_SR=m
CONFIG_CHR_DEV_SG=m

Init mouts devfsd long before modules gets loaded, I'll guess this is culprit.

dev-state as only cd entry no generic

Workaround is to add kill -HUP 'pidof devfsd` to last steps of default init 
sequence, fix is to recompile kernel an reduce these module thingys.

Where on earth have I got this idea that modules should be used when ever 
possible. Thank you for your help.
- --
Linux cartman.linux.home 2.4.19-gentoo-r7 #1 Fri Jul 5 00:45:50 EEST 2002 i686 
AuthenticAMD
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9bHmZ6BYkNNMD2uARAm51AJ44IWHpUMtJLBHakFliua2upWsHZQCfZfci
CX+9GOw7HDT/UEA8D1l8MIY=
=pwsi
-----END PGP SIGNATURE-----




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [gentoo-dev] CDRW permissions and devfsd
       [not found]         ` <200208310307.36201.bauno@inwind.it>
@ 2002-09-02 17:15           ` Yrjö Hatakka
  2002-09-02 18:06             ` Martin Schlemmer
  0 siblings, 1 reply; 15+ messages in thread
From: Yrjö Hatakka @ 2002-09-02 17:15 UTC (permalink / raw
  To: Bauno; +Cc: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Saturday 31 August 2002 04:07, Bauno wrote:

>
> I have "sg" compiled as module, and solved the problem with this entry in
> devfsd.conf (may be wrapped):
>
> LOOKUP          ^sg.*$      MODLOAD ACTION sg
> REGISTER        ^scsi/host.*/bus.*/target.*/lun.*/generic    PERMISSIONS
> root.disk 660
>
> It works, even if I'm not sure why :)

Yes, confirmed :) this really works, thanx

- -- 
Linux cartman.linux.home 2.4.19-gentoo-r7 #1 Fri Jul 5 00:45:50 EEST 2002 i686 
AuthenticAMD 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9c5yx6BYkNNMD2uARAuTTAJkBLqDToZwsXElwh8j8F3mZvt1b+QCfTuE+
nZmMDi6fKsR2srUtsWfSOYo=
=VQBk
-----END PGP SIGNATURE-----




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [gentoo-dev] CDRW permissions and devfsd
  2002-09-02 17:15           ` Yrjö Hatakka
@ 2002-09-02 18:06             ` Martin Schlemmer
  2002-09-02 19:03               ` Bauno
  0 siblings, 1 reply; 15+ messages in thread
From: Martin Schlemmer @ 2002-09-02 18:06 UTC (permalink / raw
  To: Yrjö Hatakka; +Cc: Bauno, Gentoo-Dev

On Mon, 2002-09-02 at 19:15, Yrjö Hatakka wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Saturday 31 August 2002 04:07, Bauno wrote:
> 
> >
> > I have "sg" compiled as module, and solved the problem with this entry in
> > devfsd.conf (may be wrapped):
> >
> > LOOKUP          ^sg.*$      MODLOAD ACTION sg

Tells devfs to load the 'sg' module if /dev/sg* is accessed

> > REGISTER        ^scsi/host.*/bus.*/target.*/lun.*/generic    PERMISSIONS
> > root.disk 660

Basically just set the permissions to 0660, and ownership to root.disk
when /dev/sg* is registered (the generic scsi module loaded ..)

> >
> > It works, even if I'm not sure why :)
> 
> Yes, confirmed :) this really works, thanx
>

We have the PERMISSIONS entry in our /etc/devfsd.conf:

-----------------------cut-------------------------------------
# Give the cdrw group write permissions to /dev/sg0
# This is done to have non root user use the burner (scan the scsi bus)
#REGISTER        ^sg0$       PERMISSIONS root.cdrw 660
---------------------------------------------------------------

Just commented by default.  As I always have my generic scsi into
kernel, I am not sure that first line is really needed, as there is an
alias in /etc/modules.devfs.  Will try to find the time though to
verify it.
 


> - -- 
> Linux cartman.linux.home 2.4.19-gentoo-r7 #1 Fri Jul 5 00:45:50 EEST 2002 i686 
> AuthenticAMD 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.7 (GNU/Linux)
> 
> iD8DBQE9c5yx6BYkNNMD2uARAuTTAJkBLqDToZwsXElwh8j8F3mZvt1b+QCfTuE+
> nZmMDi6fKsR2srUtsWfSOYo=
> =VQBk
> -----END PGP SIGNATURE-----
> 
> 
> _______________________________________________
> gentoo-dev mailing list
> gentoo-dev@gentoo.org
> http://lists.gentoo.org/mailman/listinfo/gentoo-dev
-- 

Martin Schlemmer
Gentoo Linux Developer, Desktop Team Developer
Cape Town, South Africa




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [gentoo-dev] CDRW permissions and devfsd
  2002-09-02 18:06             ` Martin Schlemmer
@ 2002-09-02 19:03               ` Bauno
  2002-09-03  0:37                 ` Martin Schlemmer
  0 siblings, 1 reply; 15+ messages in thread
From: Bauno @ 2002-09-02 19:03 UTC (permalink / raw
  To: Martin Schlemmer; +Cc: gentoo-dev

On Monday 02 September 2002 20:06, Martin Schlemmer wrote:
> We have the PERMISSIONS entry in our /etc/devfsd.conf:
>
> -----------------------cut-------------------------------------
> # Give the cdrw group write permissions to /dev/sg0
> # This is done to have non root user use the burner (scan the scsi bus)
> #REGISTER        ^sg0$       PERMISSIONS root.cdrw 660
> ---------------------------------------------------------------
>
> Just commented by default.  As I always have my generic scsi into
> kernel, I am not sure that first line is really needed, as there is an
> alias in /etc/modules.devfs.  Will try to find the time though to
> verify it.

The original line in devfsd.conf (that you report above) doesn't work if sg 
is compiled as module. You need to set the permissions on the 
scsi/bus/.../generic and not on the symbolic links /dev/sg*. I *think* it's 
because /dev/sg* doesn't exist (yet) when devfsd tries to apply the 
permissions, but I may be wrong.


-- 
Bauno - Eurydices, oro, properata retexite fata!
"Even now I can feel it. Buried somewhere deep inside. Watching me... 
waiting. But you know what scares me the most. When I can't fight it 
anymore. When it takes over. When I totally lose control. I like it."



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [gentoo-dev] CDRW permissions and devfsd
  2002-09-02 19:03               ` Bauno
@ 2002-09-03  0:37                 ` Martin Schlemmer
  2002-09-03  1:04                   ` Bauno
  0 siblings, 1 reply; 15+ messages in thread
From: Martin Schlemmer @ 2002-09-03  0:37 UTC (permalink / raw
  To: Bauno; +Cc: Gentoo-Dev

On Mon, 2002-09-02 at 21:03, Bauno wrote:
> On Monday 02 September 2002 20:06, Martin Schlemmer wrote:
> > We have the PERMISSIONS entry in our /etc/devfsd.conf:
> >
> > -----------------------cut-------------------------------------
> > # Give the cdrw group write permissions to /dev/sg0
> > # This is done to have non root user use the burner (scan the scsi bus)
> > #REGISTER        ^sg0$       PERMISSIONS root.cdrw 660
> > ---------------------------------------------------------------
> >
> > Just commented by default.  As I always have my generic scsi into
> > kernel, I am not sure that first line is really needed, as there is an
> > alias in /etc/modules.devfs.  Will try to find the time though to
> > verify it.
> 
> The original line in devfsd.conf (that you report above) doesn't work if sg 
> is compiled as module. You need to set the permissions on the 
> scsi/bus/.../generic and not on the symbolic links /dev/sg*. I *think* it's 
> because /dev/sg* doesn't exist (yet) when devfsd tries to apply the 
> permissions, but I may be wrong.
> 

No, the REGISTER means it only gets done when the /dev/sg0 device is
registered in the devfs namespace.  The only real difference between
that line, and:

REGISTER        ^sg.*$       PERMISSIONS root.disk 660

is that above works for *all* /dev/sg* devices, and have group as "disk"
and not "cdrw".  devfsd knows to give the permissions to the real device
in a line such as above.

The real fix for modules, is the line:

LOOKUP          ^sg.*$      MODLOAD ACTION sg

which cause the "sg" module to be loaded when you "lookup" (try to
open) /dev/sg*

> 
> -- 
> Bauno - Eurydices, oro, properata retexite fata!
> "Even now I can feel it. Buried somewhere deep inside. Watching me... 
> waiting. But you know what scares me the most. When I can't fight it 
> anymore. When it takes over. When I totally lose control. I like it."
> 
> _______________________________________________
> gentoo-dev mailing list
> gentoo-dev@gentoo.org
> http://lists.gentoo.org/mailman/listinfo/gentoo-dev
-- 

Martin Schlemmer
Gentoo Linux Developer, Desktop Team Developer
Cape Town, South Africa




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [gentoo-dev] CDRW permissions and devfsd
  2002-09-03  0:37                 ` Martin Schlemmer
@ 2002-09-03  1:04                   ` Bauno
  2002-09-03 17:57                     ` Martin Schlemmer
  0 siblings, 1 reply; 15+ messages in thread
From: Bauno @ 2002-09-03  1:04 UTC (permalink / raw
  To: Martin Schlemmer; +Cc: gentoo-dev

On Tuesday 03 September 2002 02:37, Martin Schlemmer wrote:
> > [snipped]
> > The original line in devfsd.conf (that you report above) doesn't work
> > if sg is compiled as module. You need to set the permissions on the
> > scsi/bus/.../generic and not on the symbolic links /dev/sg*. I *think*
> > it's because /dev/sg* doesn't exist (yet) when devfsd tries to apply
> > the permissions, but I may be wrong.
>
> No, the REGISTER means it only gets done when the /dev/sg0 device is
> registered in the devfs namespace.  
> 
> The real fix for modules, is the line:
>
> LOOKUP          ^sg.*$      MODLOAD ACTION sg
>
> which cause the "sg" module to be loaded when you "lookup" (try to
> open) /dev/sg*

I really don't think so (everything's wrapped):

Default Gentoo style:

------------------devfsd.conf-----------------------------------------------

# Give the cdrw group write permissions to /dev/sg0
# This is done to have non root user use the burner (scan the scsi bus)
LOOKUP          ^sg.*$      MODLOAD ACTION sg
#REGISTER        ^scsi/host.*/bus.*/target.*/lun.*/generic    PERMISSIONS 
root.disk 660
REGISTER        ^sg.*$       PERMISSIONS root.disk 660

--------------devfsd.conf---------------------------------------------------

bauniga root # modprobe sg
bauniga root # ll /dev/scsi/host0/bus0/target0/lun0/generic
crw-r-----    1 root     root      21,   0 Jan  1  1970 
/dev/scsi/host0/bus0/target0/lun0/generic
bauniga root # killall -HUP devfsd
bauniga root # ll /dev/scsi/host0/bus0/target0/lun0/generic
crw-rw----    1 root     disk      21,   0 Jan  1  1970 
/dev/scsi/host0/bus0/target0/lun0/generic




Bauno :) style:

----------------------------devfsd.conf------------------------------------
# Give the cdrw group write permissions to /dev/sg0
# This is done to have non root user use the burner (scan the scsi bus)
LOOKUP          ^sg.*$      MODLOAD ACTION sg
REGISTER        ^scsi/host.*/bus.*/target.*/lun.*/generic    PERMISSIONS 
root.disk 660
#REGISTER        ^sg.*$       PERMISSIONS root.disk 660
--------------devfsd.conf---------------------------------------------------

bauniga root # modprobe sg
bauniga root # ll /dev/scsi/host0/bus0/target0/lun0/generic
crw-rw----    1 root     disk      21,   0 Jan  1  1970 
/dev/scsi/host0/bus0/target0/lun0/generic


So, I think the Gentoo default devfsd.conf isn't well suited for the sg 
module....

-- 
Bauno - Eurydices, oro, properata retexite fata!
"Even now I can feel it. Buried somewhere deep inside. Watching me... 
waiting. But you know what scares me the most. When I can't fight it 
anymore. When it takes over. When I totally lose control. I like it."



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [gentoo-dev] CDRW permissions and devfsd
  2002-09-03  1:04                   ` Bauno
@ 2002-09-03 17:57                     ` Martin Schlemmer
  2002-09-03 18:33                       ` Bauno
  0 siblings, 1 reply; 15+ messages in thread
From: Martin Schlemmer @ 2002-09-03 17:57 UTC (permalink / raw
  To: Bauno; +Cc: Gentoo-Dev

On Tue, 2002-09-03 at 03:04, Bauno wrote:
> On Tuesday 03 September 2002 02:37, Martin Schlemmer wrote:
> > > [snipped]
> > > The original line in devfsd.conf (that you report above) doesn't work
> > > if sg is compiled as module. You need to set the permissions on the
> > > scsi/bus/.../generic and not on the symbolic links /dev/sg*. I *think*
> > > it's because /dev/sg* doesn't exist (yet) when devfsd tries to apply
> > > the permissions, but I may be wrong.
> >
> > No, the REGISTER means it only gets done when the /dev/sg0 device is
> > registered in the devfs namespace.  
> > 
> > The real fix for modules, is the line:
> >
> > LOOKUP          ^sg.*$      MODLOAD ACTION sg
> >
> > which cause the "sg" module to be loaded when you "lookup" (try to
> > open) /dev/sg*
> 
> I really don't think so (everything's wrapped):
> 

I tend to disagree.  At least if not as module:

----------------------------------------------cut-------------------------------------------------
workshop portage # grep root\.cdrw /etc/devfsd.conf 
#REGISTER        ^sg0$       PERMISSIONS root.cdrw 660
workshop portage # ls -l /dev/scsi/host0/bus0/target0/lun0/generic
crw-------    1 workshop root      21,   0 Jan  1  1970 /dev/scsi/host0/bus0/target0/lun0/generic
workshop portage # vim /etc/devfsd.conf 
workshop portage # grep root\.cdrw /etc/devfsd.conf 
REGISTER        ^sg0$       PERMISSIONS root.cdrw 660
workshop portage # killall -HUP devfsd
workshop portage # ls -l /dev/scsi/host0/bus0/target0/lun0/generic
crw-rw----    1 root     cdrw      21,   0 Jan  1  1970 /dev/scsi/host0/bus0/target0/lun0/generic
workshop portage # vim /etc/devfsd.conf 
workshop portage # grep root\.cdrw /etc/devfsd.conf 
#REGISTER        ^sg0$       PERMISSIONS root.cdrw 660
workshop portage # killall -HUP devfsd
workshop portage # ls -l /dev/scsi/host0/bus0/target0/lun0/generic
crw-rw----    1 root     cdrw      21,   0 Jan  1  1970 /dev/scsi/host0/bus0/target0/lun0/generic
workshop portage # chmod 0600 /dev/scsi/host0/bus0/target0/lun0/generic
workshop portage # chown root.root /dev/scsi/host0/bus0/target0/lun0/generic
workshop portage # killall -HUP devfsd
workshop portage # ls -l /dev/scsi/host0/bus0/target0/lun0/generic
crw-------    1 root     root      21,   0 Jan  1  1970 /dev/scsi/host0/bus0/target0/lun0/generic
workshop portage # vim /etc/devfsd.conf 
workshop portage # grep root\.cdrw /etc/devfsd.conf 
REGISTER        ^sg.*$       PERMISSIONS root.cdrw 660
workshop portage # killall -HUP devfsd
workshop portage # ls -l /dev/scsi/host0/bus0/target0/lun0/generic
crw-rw----    1 root     cdrw      21,   0 Jan  1  1970 /dev/scsi/host0/bus0/target0/lun0/generic
workshop portage # 
--------------------------------------------------------------------------------------------------

So it works for changing the permissions on sg0 and sg*.  Like I already
said, because I usually have it compiled in, ill have to recompile and
check if as module.

Also, I think you are going about this the wrong way.  devfsd acts on
triggers.  The default of cdrecord is to probe /dev/sg*, and not
/dev/scsi/host.*/bus.*/target.*/lun.*/generic.  Thus rmmod sg, change to
the "Default Gentoo style" devfsd.conf, killall -HUP devfsd, and then
do: ls /dev/sg0.  After this check the permissions on
/dev/scsi/host0/bus0/target0/lun0/generic.


> Default Gentoo style:
> 
> ------------------devfsd.conf-----------------------------------------------
> 
> # Give the cdrw group write permissions to /dev/sg0
> # This is done to have non root user use the burner (scan the scsi bus)
> LOOKUP          ^sg.*$      MODLOAD ACTION sg
> #REGISTER        ^scsi/host.*/bus.*/target.*/lun.*/generic    PERMISSIONS 
> root.disk 660
> REGISTER        ^sg.*$       PERMISSIONS root.disk 660
> 
> --------------devfsd.conf---------------------------------------------------
> 
> bauniga root # modprobe sg
> bauniga root # ll /dev/scsi/host0/bus0/target0/lun0/generic
> crw-r-----    1 root     root      21,   0 Jan  1  1970 
> /dev/scsi/host0/bus0/target0/lun0/generic
> bauniga root # killall -HUP devfsd
> bauniga root # ll /dev/scsi/host0/bus0/target0/lun0/generic
> crw-rw----    1 root     disk      21,   0 Jan  1  1970 
> /dev/scsi/host0/bus0/target0/lun0/generic
> 
> 
> 
> 
> Bauno :) style:
> 
> ----------------------------devfsd.conf------------------------------------
> # Give the cdrw group write permissions to /dev/sg0
> # This is done to have non root user use the burner (scan the scsi bus)
> LOOKUP          ^sg.*$      MODLOAD ACTION sg
> REGISTER        ^scsi/host.*/bus.*/target.*/lun.*/generic    PERMISSIONS 
> root.disk 660
> #REGISTER        ^sg.*$       PERMISSIONS root.disk 660
> --------------devfsd.conf---------------------------------------------------
> 
> bauniga root # modprobe sg
> bauniga root # ll /dev/scsi/host0/bus0/target0/lun0/generic
> crw-rw----    1 root     disk      21,   0 Jan  1  1970 
> /dev/scsi/host0/bus0/target0/lun0/generic
> 
> 
> So, I think the Gentoo default devfsd.conf isn't well suited for the sg 
> module....
> 
> -- 
> Bauno - Eurydices, oro, properata retexite fata!
> "Even now I can feel it. Buried somewhere deep inside. Watching me... 
> waiting. But you know what scares me the most. When I can't fight it 
> anymore. When it takes over. When I totally lose control. I like it."
-- 

Martin Schlemmer
Gentoo Linux Developer, Desktop Team Developer
Cape Town, South Africa




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [gentoo-dev] CDRW permissions and devfsd
  2002-09-03 17:57                     ` Martin Schlemmer
@ 2002-09-03 18:33                       ` Bauno
  0 siblings, 0 replies; 15+ messages in thread
From: Bauno @ 2002-09-03 18:33 UTC (permalink / raw
  To: Martin Schlemmer; +Cc: Gentoo-Dev

On Tuesday 03 September 2002 19:57, Martin Schlemmer wrote:
> > I really don't think so (everything's wrapped):
>
> I tend to disagree.  At least if not as module:

Of course, if "scsi generic suport" is compiled in the kernel, and not as a 
module, everything works perfectly. No problems at all. But if it's 
compiled as a module (sg), the default devfsd.conf doesn't work...you 
either have to killall -HUP devfsd AFTER the sg module is loaded, or change 
permissions on /dev/scsi/..../generic and NOT on /dev/sg*.

> Also, I think you are going about this the wrong way.  devfsd acts on
> triggers.  The default of cdrecord is to probe /dev/sg*, and not
> /dev/scsi/host.*/bus.*/target.*/lun.*/generic.  Thus rmmod sg, change to
> the "Default Gentoo style" devfsd.conf, killall -HUP devfsd, and then
> do: ls /dev/sg0.  After this check the permissions on
> /dev/scsi/host0/bus0/target0/lun0/generic.

Been there, done that: wrong permissions:

bauniga linux # rmmod sg
bauniga linux # killall -HUP devfsd
bauniga linux # ll /dev/sg0
lr-xr-xr-x    1 root     root           36 Sep  3 20:29 /dev/sg0 -> 
scsi/host0/bus0/target0/lun0/generic
bauniga linux # ll /dev/scsi/host0/bus0/target0/lun0/generic
crw-r-----    1 root     root      21,   0 Jan  1  1970 
/dev/scsi/host0/bus0/target0/lun0/generic


Sorry, but I think I'm right :) : if sg is compiled as module, you either 
killall -HUP devfsd *after* sg is loaded, or change the default devfsd.conf 
as I described in a previous e-mail.


-- 
Bauno - Eurydices, oro, properata retexite fata!
"Even now I can feel it. Buried somewhere deep inside. Watching me... 
waiting. But you know what scares me the most. When I can't fight it 
anymore. When it takes over. When I totally lose control. I like it."



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2002-09-03 18:36 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-25 20:55 [gentoo-dev] CDRW permissions and devfsd Yrjö Hatakka
2002-08-27  0:00 ` Burton Samograd
2002-08-27  7:48   ` Yrjö Hatakka
2002-08-27  5:22     ` Burton Samograd
2002-08-27 13:23 ` Stuart Bouyer
2002-08-27 22:39   ` Yrjö Hatakka
2002-08-28  2:09     ` Stuart Bouyer
2002-08-28  7:19       ` Yrjö Hatakka
     [not found]         ` <200208310307.36201.bauno@inwind.it>
2002-09-02 17:15           ` Yrjö Hatakka
2002-09-02 18:06             ` Martin Schlemmer
2002-09-02 19:03               ` Bauno
2002-09-03  0:37                 ` Martin Schlemmer
2002-09-03  1:04                   ` Bauno
2002-09-03 17:57                     ` Martin Schlemmer
2002-09-03 18:33                       ` Bauno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox