LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 03-05-2015, 01:46 AM   #1
byran cheung
Member
 
Registered: Sep 2013
Posts: 321

Rep: Reputation: Disabled
Centos 7 startup script


I have a Centos 7 server which setup by previous system administrator , when this server startup , it will start some service eg. apache , mysql etc, but I could not find the startup script at /etc/rc.local /etc/rc.d/rc.local or /etc/rc.d/init.d , would advise which path will be the startup script keep ?

Thanks
 
Old 03-05-2015, 02:11 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
probably in /etc/rcX.d where X is the current runlevel (a number)
 
Old 03-05-2015, 02:23 AM   #3
byran cheung
Member
 
Registered: Sep 2013
Posts: 321

Original Poster
Rep: Reputation: Disabled
thanks reply,

checked , in /etc/rc3.d , there are the below files , but it do not have apache , mysql startup.

lrwxrwxrwx. 1 root root 17 Nov 29 22:26 S10network -> ../init.d/network
lrwxrwxrwx. 1 root root 17 Nov 29 22:26 S21iprdump -> ../init.d/iprdump
lrwxrwxrwx. 1 root root 17 Nov 28 22:29 S20iprinit -> ../init.d/iprinit
lrwxrwxrwx. 1 root root 19 Nov 28 22:29 S20iprupdate -> ../init.d/iprupdate
lrwxrwxrwx. 1 root root 20 Nov 28 22:27 K50netconsole -> ../init.d/netconsole
 
Old 03-05-2015, 02:41 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
and what about the other rcX.d directories?
 
Old 03-05-2015, 02:46 AM   #5
byran cheung
Member
 
Registered: Sep 2013
Posts: 321

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
and what about the other rcX.d directories?
the default runlevel is 3 , so I check rc3.d directory.
 
Old 03-05-2015, 03:23 AM   #6
byran cheung
Member
 
Registered: Sep 2013
Posts: 321

Original Poster
Rep: Reputation: Disabled
I find the httpd service could be restart by systemctl
# systemctl restart httpd.service

But I could not find mysql by the following command .

#systemctl |grep mysql
 
Old 03-05-2015, 06:23 AM   #7
naitso
LQ Newbie
 
Registered: Aug 2010
Posts: 14

Rep: Reputation: 2
Centos 7 startup script

hi, check systemd documentations
 
Old 03-05-2015, 07:52 PM   #8
byran cheung
Member
 
Registered: Sep 2013
Posts: 321

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by naitso View Post
hi, check systemd documentations
thanks reply ,

I check systemd document , I found the httpd.service but do not find how mysql could be started , would advise how the mysql service is started ? thanks
 
Old 03-05-2015, 09:42 PM   #9
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
Centos 7 uses systemd to control daemons with the user tool systemctl

The default database is mariadb, replacing mysql, so systemctl start mariadb.service should start mariadb. You might want to run mysql_secure_installation as soon as you get the database started.
 
Old 03-06-2015, 12:05 AM   #10
byran cheung
Member
 
Registered: Sep 2013
Posts: 321

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Doug G View Post
Centos 7 uses systemd to control daemons with the user tool systemctl

The default database is mariadb, replacing mysql, so systemctl start mariadb.service should start mariadb. You might want to run mysql_secure_installation as soon as you get the database started.
thanks reply ,

yes , I know centos comes with mariadb .

what I want is to know how my existing server ( installed by previous colleagues) start mysql db at startup , I could not find how it could be start at bootup .

thanks
 
Old 03-06-2015, 01:13 AM   #11
byran cheung
Member
 
Registered: Sep 2013
Posts: 321

Original Poster
Rep: Reputation: Disabled
may be I have a bit confuse , I just the service is as below , it is mysql or mariadb ? the service is started when reboot .

mysql 1681 1 0 Feb01 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
mysql 2011 1681 0 Feb01 ? 00:00:42 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariadb/mariadb.pid --socket=/var/lib/mysql/mysql.sock
root 3891 3364 0 15:09 pts/0 00:00:00 grep --color=auto mysql
 
Old 03-06-2015, 12:55 PM   #12
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
systemctl status mariadb.service will tell you if the serveice is running.

Most of the programs for the database are still named mysql. From the command line, you can use mysql, mysqldump, etc. with a mariadb database.
 
Old 03-06-2015, 01:58 PM   #13
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by byran cheung View Post
what I want is to know how my existing server ( installed by previous colleagues) start mysql db at startup , I could not find how it could be start at bootup .
It's systemd, it's a black box. There is probably a mariadb.service entry in /usr/lib/systemd/system which tells systemd how mariadb should be started, but the actual startup is going to be buried inside systemd's innards.
 
  


Reply



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
Bash script works different as startup script - any ideas ? robinaspey Linux - Newbie 2 06-11-2014 02:07 PM
apache tomcat startup script not booting at startup. Grtyop Linux - Newbie 2 01-23-2014 02:57 AM
i need a script to check my startup for start restart stop linux centos tayseerj Programming 1 06-16-2010 06:11 AM
'cannot stat' script in /etc/rc.d/, try to run script at startup quintan Linux - Software 1 11-21-2005 02:53 AM
How to call a script from a system startup script? jonatito Linux - Newbie 7 11-11-2005 09:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:22 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration