LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 08-30-2004, 01:21 PM   #1
samac
Senior Member
 
Registered: Mar 2004
Location: Westray, Orkney
Distribution: Slackware64-14.1 (multi-lib) KDE 4.11.4
Posts: 1,422

Rep: Reputation: 137Reputation: 137
Hotplug SCSI scanner or How to write to /proc/scsi/scsi from within a shell script.


Hi

I am trying to write the folowing code into a shell script, to enable me to hotplug a scsi scanner, without giving out the root pasword to the users. (Wife and Child)

Code as follows

#!/bin/bash
#
# A small script to automatically mount the scanner and start xsane.
#
typeset -i num
num=`cat /proc/scsi/scsi | grep Scanner | wc -l`
if [ $num -eq 1 ]; then
echo "scsi add-single-device 1 0 6 0" > /proc/scsi/scsi
xsane
else
xsane
fi

The script runs as root or suid, but when running as suid it will not write to /proc/scsi/scsi permission not granted and I am unable to change the permissions of /proc (for good reason).
 
Old 08-30-2004, 02:28 PM   #2
samac
Senior Member
 
Registered: Mar 2004
Location: Westray, Orkney
Distribution: Slackware64-14.1 (multi-lib) KDE 4.11.4
Posts: 1,422

Original Poster
Rep: Reputation: 137Reputation: 137
I've found a solution Thanks anyway.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Scanner Umax 2200 (USB,SCSI) with AHA2940U scsi card problem in Suse 9.2 Pro nathanv117 Suse/Novell 5 02-22-2005 02:06 PM
SCSI Scanner Hotplug Question failure_man Linux - Hardware 1 10-18-2004 12:17 PM
Error editing /proc/scsi scsi file Thaidog Linux - Newbie 2 08-26-2004 08:19 AM
Some info about '/proc/scsi/scsi' and '/dev' C.Loko Slackware 4 11-27-2003 12:30 PM
allow non root users add devices to /proc/scsi/scsi ? ewto Linux - Newbie 5 10-14-2003 11:36 AM


All times are GMT -5. The time now is 10:34 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration