LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   yum --installroot service httpd mysqld not recognize (https://www.linuxquestions.org/questions/linux-newbie-8/yum-installroot-service-httpd-mysqld-not-recognize-4175433463/)

noufal_pv 10-22-2012 05:19 AM

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

acid_kewpie 10-22-2012 05:37 AM

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?

noufal_pv 10-22-2012 05:40 AM

Quote:

Originally Posted by acid_kewpie (Post 4812039)
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.

acid_kewpie 10-22-2012 05:45 AM

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?

noufal_pv 10-22-2012 05:50 AM

How can I redirect MySQL default database to the /data drive atleast?

noufal_pv 10-22-2012 05:53 AM

[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]#

acid_kewpie 10-22-2012 05:54 AM

Google says you can just change the DATADIR value in my.cnf

acid_kewpie 10-22-2012 05:56 AM

Quote:

Originally Posted by noufal_pv (Post 4812051)
[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

noufal_pv 10-22-2012 05:57 AM

please provide location of my.cnf
also google link

acid_kewpie 10-22-2012 05:59 AM

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.

noufal_pv 10-22-2012 05:59 AM

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]#

noufal_pv 10-22-2012 08:53 AM

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?

acid_kewpie 10-22-2012 08:59 AM

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


All times are GMT -5. The time now is 06:49 PM.