LinuxQuestions.org
Help answer threads with 0 replies.
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 08-05-2013, 03:08 AM   #1
thirstonlinux
Member
 
Registered: Jul 2011
Posts: 62

Rep: Reputation: Disabled
command to control multiple services


Could someone tell me which command is used to enable/Disable and start/stop mutiple services at the same time in RHEL6.
 
Old 08-05-2013, 03:13 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,

not sure what you mean by "at the same time", but AFAIK chkconfig and service are still the primary way to enable/disable and start/stop services on RHEL.

A quick search indicates there is also a gui called system-config-services.

Evo2.
 
1 members found this post helpful.
Old 08-05-2013, 03:14 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390
Quote:
Originally Posted by thirstonlinux View Post
Could someone tell me which command is used to enable/Disable and start/stop mutiple services at the same time in RHEL6.
Services are started individually.

service service_name start
service service_name stop

EDIT: Too slow.... again

Last edited by druuna; 08-05-2013 at 03:15 AM.
 
Old 08-05-2013, 04:21 AM   #4
eklavya
Member
 
Registered: Mar 2013
Posts: 622

Rep: Reputation: 136Reputation: 136
you can use
Quote:
&&
and enable and disable multiple services in single command.
 
Old 08-05-2013, 04:30 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
Thinking a little laterally, you may be asking about xinetd if the above doesn't satisfy you
http://www.linuxtopia.org/online_boo...rappers-xinetd
 
Old 08-05-2013, 07:48 AM   #6
sharadchhetri
Member
 
Registered: Aug 2008
Location: INDIA
Distribution: Redhat,Debian,Suse,Windows
Posts: 179

Rep: Reputation: 23
As such a single command I never heard but yes you can do the task through scripting
Chris already suggested with xinetd and so just read and explore

Other than if you are interested to go with scripting you can follow the given below details

To start and stop the service, the command is "service service-name start" and "service service-name stop"
And to disable and enable the service at runlevel (bydefault runlevel 3 and 5) , we have command "chkconfig service-name on" or "chkconfig service-name off" .

I assume your requirement is to start/stop and disable/enable multiple service through command line.
If it is like that create a script or even you can directly write on terminal without creating any shell script file

eg. I have a few service like httpd,mysqld and iptables. Now I want to disable/enable or stop/start the service

For stopping

Quote:
for i in httpd mysqld iptables ;do service $i stop;chkconfig $i off;done
OR

Create a file called service-list and write down all service name in this manner

httpd
mysqld
iptables

then script will be like this

Quote:
for i in `cat service-list`;do service $i stop;chkconfig $i off;done
And For start again

Quote:
for i in httpd mysqld iptables ;do service $i start;chkconfig $i on;done
OR

Quote:
for i in `cat service-list`;do service $i start;chkconfig $i on;done

Last edited by sharadchhetri; 08-05-2013 at 07:52 AM.
 
Old 08-06-2013, 07:34 AM   #7
thirstonlinux
Member
 
Registered: Jul 2011
Posts: 62

Original Poster
Rep: Reputation: Disabled
I am looking for a console to open when I enter a command. And the console should list all the services and I have to just just check or uncheck to disable/Enable Start/Stop service.
 
Old 08-06-2013, 07:41 AM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
If you're running a gui, there's usually such a thing under something like Admin=>Services.
If you want a similar (but simpler) thing on a cli, try 'ntsysv' http://linux.die.net/man/8/ntsysv
 
2 members found this post helpful.
Old 08-06-2013, 08:07 AM   #9
sharadchhetri
Member
 
Registered: Aug 2008
Location: INDIA
Distribution: Redhat,Debian,Suse,Windows
Posts: 179

Rep: Reputation: 23
Agreed ,ntsysv will work. Your first question was confusing if I relate with your second comment ,in which you have clearly brief.
 
Old 08-06-2013, 09:04 PM   #10
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,
Quote:
Originally Posted by thirstonlinux View Post
I am looking for a console to open when I enter a command. And the console should list all the services and I have to just just check or uncheck to disable/Enable Start/Stop service.

that sounds like Debians rcconf. See http://packages.debian.org/wheezy/rcconf (includes a screen shot).
I'm not aware of an equivalent for RHEL.

Evo2.
 
  


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
resolution for linux...Services control kapilbajpai88 Linux - Newbie 2 03-03-2009 12:57 PM
Control of services at startup in Etch altella Debian 2 07-17-2007 10:49 AM
control of running services monohouse Linux - Software 5 01-17-2005 12:08 PM
single IP multiple services mchitrakar Linux - Networking 4 06-02-2004 08:58 PM
Mandrake Control Center: Services not saving? leiavoia Linux - General 0 06-13-2002 09:51 PM

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

All times are GMT -5. The time now is 12:12 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration