LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 10-22-2012, 05:19 AM   #1
noufal_pv
LQ Newbie
 
Registered: Oct 2012
Posts: 11

Rep: Reputation: Disabled
Post yum --installroot service httpd mysqld not recognize


When I install software apache, mysql-server or any other by specifying destination directory
Service cannot recognize
There are the commands I used
yum --installroot=/data install mysql-server
yum --installroot=/data/ install httpd
error
[root@lrsxfcp19052 ~]# /sbin/service httpd start
httpd: unrecognized service
[root@lrsxfcp19052 ~]# /sbin/service mysqld start
mysqld: unrecognized service

[root@lrsxfcp19052 ~]#
[root@lrsxfcp19052 ~]# df -TH
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda1 ext4 143G 2.7G 133G 2% /
tmpfs tmpfs 34G 0 34G 0% /dev/shm
/dev/sdb1 ext4 2.0T 1.3G 1.9T 1% /data
[root@lrsxfcp19052 ~]#

Same time if I remove the software and install without specifying installroot ,it works
But I want to install all the package to the new Raid Disk
 
Old 10-22-2012, 05:37 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,384

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
I'd really suggest you don't, but if you do need to install a standard package in a nonstandard location, then it's your responsibility to fix these things. the service command will run scripts in /etc/init.d and clearly there is no file there, and you've forced it to install in /data/etc/init.d. Note that service scripts and binary packages are NOT data, so again I'd question your logic for installing there. why not configure mysql to use that to store the database files properly?
 
Old 10-22-2012, 05:40 AM   #3
noufal_pv
LQ Newbie
 
Registered: Oct 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by acid_kewpie View Post
I'd really suggest you don't, but if you do need to install a standard package in a nonstandard location, then it's your responsibility to fix these things. the service command will run scripts in /etc/init.d and clearly there is no file there, and you've forced it to install in /data/etc/init.d. Note that service scripts and binary packages are NOT data, so again I'd question your logic for installing there. why not configure mysql to use that to store the database files properly?
/dev/sdb1 ext4 2.0T 1.3G 1.9T 1% /data is the disk containing 2TB disk space, we want all the application and data to be there.
 
Old 10-22-2012, 05:45 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,384

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
you really have called it /data then. Seriously though, that's not a good place to put mysql binaries. does it start if you call the script in /data/etc/init.d directly?
 
Old 10-22-2012, 05:50 AM   #5
noufal_pv
LQ Newbie
 
Registered: Oct 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
How can I redirect MySQL default database to the /data drive atleast?
 
Old 10-22-2012, 05:53 AM   #6
noufal_pv
LQ Newbie
 
Registered: Oct 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
[root@lrsxfcp19052 init.d]#
[root@lrsxfcp19052 init.d]# /data/etc/init.d/httpd start
Starting httpd: /bin/bash: /usr/sbin/httpd: No such file or directory
[FAILED]
[root@lrsxfcp19052 init.d]# pwd
/data/etc/init.d
[root@lrsxfcp19052 init.d]# ls -ltr
total 80
-rwxr-xr-x 1 root root 1559 May 19 2009 rdisc
-rwxr-xr-x 1 root root 8630 Feb 3 2012 iptables
-rwxrwxrwx 1 root root 3371 Feb 7 2012 httpd
-rwxr-xr-x 1 root root 647 Apr 27 05:48 single
-rwxr-xr-x 1 root root 6334 Apr 27 05:48 network
-rwxr-xr-x 1 root root 5485 Apr 27 05:48 netfs
-rwxr-xr-x 1 root root 2989 Apr 27 05:48 netconsole
-rwxr-xr-x 1 root root 652 Apr 27 05:48 killall
-rwxr-xr-x 1 root root 5777 Apr 27 05:48 halt
-rw-r--r-- 1 root root 18171 Apr 27 05:48 functions
-rwxr-xr-x 1 root root 2294 Jun 7 07:25 udev-post
[root@lrsxfcp19052 init.d]#
 
Old 10-22-2012, 05:54 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,384

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
Google says you can just change the DATADIR value in my.cnf
 
Old 10-22-2012, 05:56 AM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,384

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
Quote:
Originally Posted by noufal_pv View Post
[root@lrsxfcp19052 init.d]#
[root@lrsxfcp19052 init.d]# /data/etc/init.d/httpd start
Starting httpd: /bin/bash: /usr/sbin/httpd: No such file or directory
[FAILED]
[root@lrsxfcp19052 init.d]# pwd
/data/etc/init.d
[root@lrsxfcp19052 init.d]# ls -ltr
total 80
-rwxr-xr-x 1 root root 1559 May 19 2009 rdisc
-rwxr-xr-x 1 root root 8630 Feb 3 2012 iptables
-rwxrwxrwx 1 root root 3371 Feb 7 2012 httpd
-rwxr-xr-x 1 root root 647 Apr 27 05:48 single
-rwxr-xr-x 1 root root 6334 Apr 27 05:48 network
-rwxr-xr-x 1 root root 5485 Apr 27 05:48 netfs
-rwxr-xr-x 1 root root 2989 Apr 27 05:48 netconsole
-rwxr-xr-x 1 root root 652 Apr 27 05:48 killall
-rwxr-xr-x 1 root root 5777 Apr 27 05:48 halt
-rw-r--r-- 1 root root 18171 Apr 27 05:48 functions
-rwxr-xr-x 1 root root 2294 Jun 7 07:25 udev-post
[root@lrsxfcp19052 init.d]#
So because you've relocated about 4mb of Apache, you need to update its configs and scripts to reference all these locations. /usr/sbin/httpd is now going to be /data/usr/sbin/httpd
 
Old 10-22-2012, 05:57 AM   #9
noufal_pv
LQ Newbie
 
Registered: Oct 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
please provide location of my.cnf
also google link
 
Old 10-22-2012, 05:59 AM   #10
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,384

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
google is here ... http://google.com

my.cnf is usually in /etc/my.cnf or /etc/mysql/my.cnf

Given the apparent need to ask these questions rather than already know the answers, or feel able to fund them yourselves I really would honestly urge you to not do any of this and install everything in default locations and then configure appropriately.
 
Old 10-22-2012, 05:59 AM   #11
noufal_pv
LQ Newbie
 
Registered: Oct 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
I got it
root@lrsxfcp19052 init.d]# find / -name my.cnf

/etc/my.cnf
/data/mysql/etc/my.cnf
/data/etc/my.cnf
[root@lrsxfcp19052 init.d]#
[root@lrsxfcp19052 init.d]# cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[root@lrsxfcp19052 init.d]#
 
Old 10-22-2012, 08:53 AM   #12
noufal_pv
LQ Newbie
 
Registered: Oct 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
Sir, I uninstalled the package httpd,php,php-mysql,mysql-devel.mysql-server which was installed on /data.
still there are somefiles remaining on /data
how can I format /data? or delete all files using single command?

Last edited by noufal_pv; 10-22-2012 at 08:58 AM.
 
Old 10-22-2012, 08:59 AM   #13
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,384

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
rm -rf /data/* would do that job. Noted that /lost+found will remain there, as it's a meta directory, not a real one
 
  


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
Please help to load balancing httpd and mysqld with keepalived chobong Linux - Software 7 09-10-2010 05:04 AM
[SOLVED] rc.httpd and rc.mysqld break startup scripts geek745 Slackware 27 02-11-2009 11:45 AM
A lot of agetty, httpd and mysqld processes ilhbutshm Slackware 3 09-04-2006 12:49 PM
disabling mysqld and httpd webinsek Linux - Newbie 3 03-25-2006 12:13 PM
service httpd status, results in httpd dead but subsys locked squadja Red Hat 2 09-11-2004 10:31 PM


All times are GMT -5. The time now is 04:44 PM.

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