Skip to contentSkip to conversation

running lvm tool from user application script

linux-lvm bo 2 participants 2 messages Apr 4, 2002 – Apr 5, 2002

lore
Share & tools
lore

bo

author
#0 lore raw

LVM gurus,

I have been playing with the LVM tool for a while under ROOT privilledge. Today, I tried to run "lvscan" & "pvscan" from one of my user script
to show LVM status to user. I realized I could not run them having the attached errors.

Q1: Is that true I can not run "vgscan", "lvscan",... under user applciation which does not have "root" right?

Q2: I want to run these utilities from my CGI script for Web GUI.
Any suggestions?

Thanks in advance,

BM

ATTACH)------------------------------------------------------------------- Error2)
mooasun>$cat /etc/*tab
mooasun>$anacrontab fstab lvmtab raidtab
mooasun>$crontab inittab mtab
mooasun>$lvscan
mooasun>$lvscan -- ERROR: "/etc/lvmtab" doesnot exist; please run vgscan

Error1)
mooasun>$vgscan
mooasun>$vgscan -- LVM driver/module not loaded!

#1 lore raw

Hi,

Well, I don't really think that's an issue having to do anything with LVM. It's something to do with 'security'. On most systems 'plain' users hVe quite modest rights in the etc directory, and for quite good reasons. You get that because the mode of /etc/lvmtab doesn't allow you to write to it, as forinstance vgscan would like to do..

letting a user run those programs sounds like a pretty bad idea, but if you still want to go ahead, there's at least 2 ways around it, 1) allow the webuser to sudo that command (see sodu/sudoers), or just get a cron job on root, that runs those commands, and dumps the output in a place where your CGI thingy can read it..

Denie

----- Original Message -----
From: bo
To: [email protected]
Sent: Friday, April 05, 2002 6:27 AM
Subject: [linux-lvm] running lvm tool from user application script

LVM gurus,

I have been playing with the LVM tool for a while under ROOT privilledge. Today, I tried to run "lvscan" & "pvscan" from one of my user script to show LVM status to user. I realized I could not run them having the attached errors.

Q1: Is that true I can not run "vgscan", "lvscan",... under user applciation which does not have "root" right?

Q2: I want to run these utilities from my CGI script for Web GUI.
Any suggestions?

Thanks in advance,

BM

ATTACH)------------------------------------------------------------------- Error2)
mooasun>$cat /etc/*tab
mooasun>$anacrontab fstab lvmtab raidtab
mooasun>$crontab inittab mtab
mooasun>$lvscan
mooasun>$lvscan -- ERROR: "/etc/lvmtab" doesnot exist; please run vgscan

Error1)
mooasun>$vgscan
mooasun>$vgscan -- LVM driver/module not loaded!