Can't get it working on Centos 6.3

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Can't get it working on Centos 6.3

B0ris
I have Centos 6.3 (i686), and the latest version of MHVTL and GUI, but i can't get this GUI working.
First of all, it says that Sudo access is not configured and that mhvtl version is old. I have checked and sudo for user apache is working, and mhtml is the latest version 1.4.4.

Even if i change php code to let me into the gui, i can see that mhvtl is offline (if this is for daemon status, than this is not ok, becouse it is started).

Any suggestions ?

P.S. I install mhvtl from rpm on the official site, and also tryed to install from YUM repo EPEL.

Regards,
Boris
Reply | Threaded
Open this post in threaded view
|

Re: Can't get working on Centos 6.3

Mark Harvey
Administrator
Have you tried disabling SElinux ?

Sent from my iPad

On Jan 9, 2013, at 22:41, "B0ris [via MHVTL - Linux Virtual Tape Library - Community Forums]" <[hidden email]> wrote:

I have Centos 6.3 (i686), and the latest version of MHVTL and GUI, but i can't get this GUI working.
First of all, it says that Sudo access is not configured and that mhvtl version is old. I have checked and sudo for user apache is working, and mhtml is the latest version 1.4.4.

Even if i change php code to let me into the gui, i can see that mhvtl is offline (if this is for daemon status, than this is not ok, becouse it is started).

Any suggestions ?

P.S. I install mhvtl from rpm on the official site, and also tryed to install from YUM repo EPEL.

Regards,
Boris


To start a new topic under MHVTL - Linux Virtual Tape Library - Community Forums, email [hidden email]
To unsubscribe from MHVTL - Linux Virtual Tape Library - Community Forums, click here.
NAML
Regards from Australia
Mark Harvey
nia
Reply | Threaded
Open this post in threaded view
|

Re: Can't get it working on Centos 6.3

nia
Administrator
In reply to this post by B0ris
Could you also cd to mhvtl-gui directory as root and run the following :

sudo -u apache -S sh -xv scripts/check_before_use.sh

-nia
Reply | Threaded
Open this post in threaded view
|

Re: Can't get it working on Centos 6.3

B0ris
SELinux is disabled.
The output of the command is:

[root@localhost mhvtl]# sudo -u apache -S sh -xv scripts/check_before_use.sh
testmhvtl()
{
if [ ! -f /usr/bin/vtlcmd ] ; then
echo "FAIL" >/tmp/test.required.components.testmhvtl
echo ' FAIL: MHVTL not detected'
else
MAJORVER="1"
MINRELEASE="0"
MINVERSION="0"
_RELEASE=`sudo -u root -S /usr/bin/vtlcmd -V| awk '{print $2}'|cut -d "-" -f1`
MAJ=`echo $_RELEASE|awk -F. '{print $1}'`
RELEASE=`echo $_RELEASE|awk -F. '{print $2}'`
VERSION=`echo $_RELEASE|awk -F. '{print $3}'`
if [ $MAJORVER -eq $MAJ ]; then # Version 1.0 is OK
        echo "PASS" >/tmp/test.required.components.testmhvtl
elif [ $RELEASE -gt $MINRELEASE ] && [ $VERSION -gt $MINVERSION ] ; then
echo "PASS" >/tmp/test.required.components.testmhvtl
else
echo "FAIL" >/tmp/test.required.components.testmhvtl
echo ' FAIL: Old MHVTL versoin detected: need =>1.0.0 '
fi
fi
}


testphp()
{
CHECKPHP=`php html/testphp.php | grep ^"PHP Version"`
if [ ! -z "$CHECKPHP" ]; then
echo "PASS" >/tmp/test.required.components.testphp
else
echo ' FAIL: PHP not detected'
echo "FAIL" >/tmp/test.required.components.testphp
fi
}


testsudo()
{
CHECK=`sudo -u root -S date`
if [ $? = 0 ] ; then
echo "PASS" >/tmp/test.required.components.testsudo
else
echo ' FAIL: Sudo Access not configured'
echo "FAIL" >/tmp/test.required.components.testsudo
fi
}



testlsscsi()
{
CHECK=`lsscsi`
if [ $? = 0 ] ; then
echo "PASS" >/tmp/test.required.components.testlsscsi
else
echo ' FAIL: lsscsi not installed'
echo "FAIL" >/tmp/test.required.components.testlsscsi
fi
}

testmt()
(
CHECK=`mt -v 2>/dev/null`
if [ $? = 0 ] ; then
echo "PASS" >/tmp/test.required.components.testmt
else
CHECK=`mt -V 2>/dev/null`
if [ $? = 0 ] ; then
echo "PASS" >/tmp/test.required.components.testmt
else
echo ' FAIL: mt not installed'
echo "FAIL" >/tmp/test.required.components.testmt
fi
fi
)


testmtx()
{
CHECK=`ls /usr/sbin/mtx`
if [ $? = 0 ] ; then
echo "PASS" >/tmp/test.required.components.testmtx
else
echo ' FAIL: mtx not installed'
echo "FAIL" >/tmp/test.required.components.testmtx
fi
}

testgit()
(
CHECK=`git --version`
if [ $? = 0 ] ; then
echo "PASS" >/tmp/test.required.components.testgit
else
CHECKAGAIN=`/usr/local/bin/git --version`
if [ $? = 0 ] ; then
echo "PASS" >/tmp/test.required.components.testgit
else
echo ' WARN: git not installed'
echo "PASS" >/tmp/test.required.components.testgit
fi

fi
)

testsysstat()
(
CHECK=`iostat`
if [ $? = 0 ] ; then
echo "PASS" >/tmp/test.required.components.testsysstat
else
echo ' WARN: sysstat not installed'
echo "PASS" >/tmp/test.required.components.testsysstat
fi
)


teststgt()
(
if [ -f /usr/sbin/tgtadm ]; then
TGTADM="/usr/sbin/tgtadm"
else
TGTADM="stgt.git/usr/tgtadm"
fi

if [ -f /usr/sbin/tgtd ]; then
TGTD="/usr/sbin/tgtd"
else
TGTD="stgt.git/usr/tgtd"
fi


CHECK=`$TGTADM --help`
if [ $? = 0 ] ; then
echo "PASS" >/tmp/test.required.components.teststgt
else
echo ' WARN: stgt not installed'
echo "PASS" >/tmp/test.required.components.teststgt
fi
)

testscst()
(
CHECK=`ls /usr/local/sbin/iscsi-scstd`
if [ $? = 0 ] ; then
echo "PASS" >/tmp/test.required.components.testscst
else
echo ' WARN: scst not installed'
echo "PASS" >/tmp/test.required.components.testscst
fi
)


$1
if [ -z "$1" ] ; then
exit 0
fi
+ '[' -z '' ']'
+ exit 0
nia
Reply | Threaded
Open this post in threaded view
|

Re: Can't get it working on Centos 6.3

nia
Administrator
My apology .. Please rerun the command given earlier this way :


sudo -u apache -S sh -x scripts/check_before_use.sh testmhvtl
sudo -u apache -S sh -x scripts/check_before_use.sh testsudo


-nia
Reply | Threaded
Open this post in threaded view
|

Re: Can't get it working on Centos 6.3

B0ris
[root@localhost mhvtl]# sudo -u apache -S sh -x scripts/check_before_use.sh testmhvtl
+ testmhvtl
+ '[' '!' -f /usr/bin/vtlcmd ']'
+ MAJORVER=1
+ MINRELEASE=0
+ MINVERSION=0
++ sudo -u root -S /usr/bin/vtlcmd -V
++ awk '{print $2}'
++ cut -d - -f1
+ _RELEASE=1.3.1.el6.elrepo
++ awk -F. '{print $1}'
++ echo 1.3.1.el6.elrepo
+ MAJ=1
++ awk -F. '{print $2}'
++ echo 1.3.1.el6.elrepo
+ RELEASE=3
++ awk -F. '{print $3}'
++ echo 1.3.1.el6.elrepo
+ VERSION=1
+ '[' 1 -eq 1 ']'
+ echo PASS
+ '[' -z testmhvtl ']'

[root@localhost mhvtl]# sudo -u apache -S sh -x scripts/check_before_use.sh testsudo
+ testsudo
++ sudo -u root -S date
+ CHECK='Mon Jan 14 13:24:46 CET 2013'
+ '[' 0 = 0 ']'
+ echo PASS
+ '[' -z testsudo ']'
nia
Reply | Threaded
Open this post in threaded view
|

Re: Can't get it working on Centos 6.3

nia
Administrator
The output looks fine and does not indicate anything wrong  ....

Do you have this log in Centos 6.3 "/var/log/secure" ? perhaps some info exist to help shed some light ..

-nia
Reply | Threaded
Open this post in threaded view
|

Re: Can't get it working on Centos 6.3

sprawlsjc
In reply to this post by B0ris
I've got the same issues. The 'check_before_use.sh' script is calling for a file named 'testphp.php' in the html directory but, that file does not exist.  I have tried several different mhvtl gui downloads but, they all seem to be missing the file.
nia
Reply | Threaded
Open this post in threaded view
|

Re: Can't get it working on Centos 6.3

nia
Administrator
sprawlsjc wrote
I've got the same issues. The 'check_before_use.sh' script is calling for a file named 'testphp.php' in the html directory but, that file does not exist.  I have tried several different mhvtl gui downloads but, they all seem to be missing the file.
This code had been commented out for a while .... it should not cause any issues

<?php
/* $output = shell_exec('scripts/check_before_use.sh testphp');echo "<pre><FONT COLOR=#FFFFFF>$output</FONT></pre>"; */

-nia
nia
Reply | Threaded
Open this post in threaded view
|

Re: Can't get it working on Centos 6.3

nia
Administrator
In reply to this post by B0ris
Could you check your sudo configuration (/etc/sudoers) against mine as shows below:


Defaults   !visiblepw
Defaults    env_reset
Defaults    env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR \
                        LS_COLORS MAIL PS1 PS2 QTDIR USERNAME \
                        LANG LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION \
                        LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC \
                        LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS \
                        _XKB_CHARSET XAUTHORITY"
root    ALL=(ALL)       ALL
apache ALL=(ALL) NOPASSWD: ALL

-nia
Reply | Threaded
Open this post in threaded view
|

Re: Can't get it working on Centos 6.3

B0ris
Those two, i already checked before, and it was OK.
Login.php script is ok (that line was commented) and sudoers file is exactly as yours.

I looked at secure.log (as you mentioned before) and i found:
apache : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/var/www/html/mhvtl/html ; USER=root ; COMMAND=../scripts/check_gui.update.sh

I fixed this error in sudoers file with:
Defaults:apache !requiretty
nia
Reply | Threaded
Open this post in threaded view
|

Re: Can't get it working on Centos 6.3

nia
Administrator
B0ris wrote
Those two, i already checked before, and it was OK.
Login.php script is ok (that line was commented) and sudoers file is exactly as yours.

I looked at secure.log (as you mentioned before) and i found:
apache : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/var/www/html/mhvtl/html ; USER=root ; COMMAND=../scripts/check_gui.update.sh

I fixed this error in sudoers file with:
Defaults:apache !requiretty
So, is this issue resolved now, Are you able to use the GUI now ?
Reply | Threaded
Open this post in threaded view
|

Re: Can't get it working on Centos 6.3

B0ris
Yes, now i'm able to access GUI and at first look it seems that all is working fine :) Thank you very much for your help. BTW: great software.
Reply | Threaded
Open this post in threaded view
|

modification in go.php for mhvtl-gui

syamprasad thota
In reply to this post by Mark Harvey
Hi Mark ,

I don't have any programming skills but when I tried using your mhvtl-gui using apache and php , on login screen it shows "cannot-send-session-cache-limiter-headers-already-sent............" in browser , after I dig in google and made some changes to go.php  and now I can able to login in mhvtl-gui . The changes I made are I put "<? ob_start(); ?>" , "<? ob_flush(); ?>" and "<?php
@session_start();" instead of <?php session_start();


 
nia
Reply | Threaded
Open this post in threaded view
|

Re: modification in go.php for mhvtl-gui

nia
Administrator
syamprasad thota wrote
, on login screen it shows "cannot-send-session-cache-limiter-headers-already-sent............" in browser , after I dig in google and made some changes to go.php  and now I can able to login in mhvtl-gui . The changes I made are I put "<? ob_start(); ?>" , "<? ob_flush(); ?>" and "<?php
@session_start();" instead of <?php session_start();
Thanks, will look into this further ..

-nia
Reply | Threaded
Open this post in threaded view
|

Re: is there any possibility to create tapes on External Hard Drives

syamprasad thota
This post was updated on .
Hi mark ,
I want to create tapes on External Hard Drive , for that I created a custom library using mhvtl-gui and I changed  "Home directory: /opt/mhvtl" to "Home directory: /media/ExpansionDrive/mhvtl" in Library section of Device.conf  and I gave autorizations to vtl to that path (/media/ExpansionDrive/mhvtl) , for that I executed  "chown -R vtl:vtl /media/ExpansionDrive/mhvtl " and  " chmod -R 777 /media/ExpansionDrive/mhvtl " .
am using RHEL 5.4 , seagate 500gb ExpansionDrive , mhvtl 1.4-7
hope that every thing would be fine but when I tried to start mhvtl , it is failing to create tapes on ExpansionDrive , it shows the following error
 " make_vtl_media failed..  "
my seagate ExpansionDrive is in ntfs format , to detect that drive I installed fuse-ntfs...  rpms.
what steps I need to take to create tapes on my seagate ExpansionDrive.
 here i posted my device.conf and /var/log/message details . Please help me to create tapes ,
one more question is , is mhvtl is designed to create tapes only on internal Hard Disk not on External ?

my "device.conf" details

Library: 10 CHANNEL: 00 TARGET: 00 LUN: 00
 Vendor identification: IBM
 Product identification: 03584L32
 Product revision level: 4.02
 Unit serial number: 10000000
 NAA: 10:11:22:33:ab:00:00:00
 Home directory: /media/ExpansionDrive/mhvtl
 Backoff: 400

Drive: 1 CHANNEL: 00 TARGET: 00 LUN: 01
 Library ID: 10 Slot: 01
 Vendor identification: IBM
 Product identification: ULT3580-TD5
 Product revision level: A3K6
 Unit serial number: 10000001
 NAA: 10:11:22:33:ab:00:00:01
 Compression: factor 1 enabled 1
 Compression type: lzo
 Backoff: 400

Drive: 2 CHANNEL: 00 TARGET: 00 LUN: 2
 Library ID: 10 Slot: 2
 Vendor identification: IBM
 Product identification: ULT3580-TD5
 Product revision level: A3K6
 Unit serial number: 10000002
 NAA: 10:11:22:33:ab:00:00:2
 Compression: factor 1 enabled 1
 Compression type: lzo
 Backoff: 400

"/var/log/message" details

Mar 28 03:24:55 harvey kernel:   Vendor: Seagate   Model: Portable          Rev: 0130
Mar 28 03:24:55 harvey kernel:   Type:   Direct-Access                      ANSI SCSI revision: 04
Mar 28 03:24:55 harvey kernel: SCSI device sdb: 976773168 512-byte hdwr sectors (500108 MB)
Mar 28 03:24:55 harvey kernel: sdb: Write Protect is off
Mar 28 03:24:55 harvey kernel: sdb: assuming drive cache: write through
Mar 28 03:24:55 harvey kernel: SCSI device sdb: 976773168 512-byte hdwr sectors (500108 MB)
Mar 28 03:24:55 harvey kernel: sdb: Write Protect is off
Mar 28 03:24:55 harvey kernel: sdb: assuming drive cache: write through
Mar 28 03:24:55 harvey kernel:  sdb: sdb1
Mar 28 03:24:55 harvey kernel: sd 2:0:0:0: Attached scsi disk sdb
Mar 28 03:24:55 harvey kernel: sd 2:0:0:0: Attached scsi generic sg1 type 0
Mar 28 03:25:04 harvey kernel: fuse init (API version 7.10)
Mar 28 03:25:21 harvey ntfs-3g[7503]: Version 2010.10.2 integrated FUSE 27
Mar 28 03:25:21 harvey ntfs-3g[7503]: Mounted /dev/sdb1 (Read-Write, label "ExpansionDrive", NTFS 3.1)
Mar 28 03:25:21 harvey ntfs-3g[7503]: Cmdline options: rw,noexec,nosuid,nodev,umask=222
Mar 28 03:25:21 harvey ntfs-3g[7503]: Mount options: rw,noexec,nosuid,nodev,allow_other,nonempty,relatime,fsname=/dev/sdb1,blkdev,blksize=4096,default_permissions
Mar 28 03:25:21 harvey ntfs-3g[7503]: Global ownership and permissions enforced, configuration type 1
Mar 28 03:25:21 harvey hald: mounted /dev/sdb1 on behalf of uid 0

Mar 28 03:32:44 harvey mktape: ERROR: create_tape(): Failed to create directory /media/ExpansionDrive/mhvtl/M00172L5: Permission denied
Mar 28 03:32:44 harvey mktape: ERROR: create_tape(): Failed to create directory /media/ExpansionDrive/mhvtl/M00173L5: Permission denied
Mar 28 03:32:44 harvey mktape: ERROR: create_tape(): Failed to create directory /media/ExpansionDrive/mhvtl/M00174L5: Permission denied
Mar 28 03:32:44 harvey mktape: ERROR: create_tape(): Failed to create directory /media/ExpansionDrive/mhvtl/M00175L5: Permission denied
Mar 28 03:32:44 harvey mktape: ERROR: create_tape(): Failed to create directory /media/ExpansionDrive/mhvtl/M00176L5: Permission denied
Mar 28 03:32:44 harvey mktape: ERROR: create_tape(): Failed to create directory /media/ExpansionDrive/mhvtl/M00177L5: Permission denied
Mar 28 03:32:44 harvey mktape: ERROR: create_tape(): Failed to create directory /media/ExpansionDrive/mhvtl/M00178L5: Permission denied
Mar 28 03:32:44 harvey mktape: ERROR: create_tape(): Failed to create directory /media/ExpansionDrive/mhvtl/M00179L5: Permission denied
Mar 28 03:32:44 harvey mktape: ERROR: create_tape(): Failed to create directory /media/ExpansionDrive/mhvtl/M00180L5: Permission denied
Mar 28 03:32:44 harvey mktape: ERROR: create_tape(): Failed to create directory /media/ExpansionDrive/mhvtl/M00181L5: Permission denied
Mar 28 03:32:44 harvey mktape: ERROR: create_tape(): Failed to create directory /media/ExpansionDrive/mhvtl/M00182L5: Permission denied
Mar 28 03:32:44 harvey mktape: ERROR: create_tape(): Failed to create directory /media/ExpansionDrive/mhvtl/M00183L5: Permission denied
Mar 28 03:32:44 harvey mktape: ERROR: create_tape(): Failed to create directory /media/ExpansionDrive/mhvtl/M00184L5: Permission denied
Mar 28 03:32:55 harvey tgtd: libibverbs.so: cannot open shared object file: No such file or directory - iser transport not used


, if there is any possibility in creating tapes on External Hard Drives please help me ........


Reply | Threaded
Open this post in threaded view
|

Re: is there any possibility to create tapes on External Hard Drives

Mark Harvey
Administrator
Mar 28 03:25:21 harvey ntfs-3g[7503]: Cmdline options: rw,noexec,nosuid,nodev,umask=222
A umask of 222 will dis-allow writes

test by 'su - vtl'
then change to directory and confirm you can write as the 'vtl' user account
Regards from Australia
Mark Harvey