LinuxQuestions.org
Help answer threads with 0 replies.
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 08-05-2013, 02: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, 02:13 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
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, 02:14 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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 02:15 AM.
 
Old 08-05-2013, 03:21 AM   #4
eklavya
Member
 
Registered: Mar 2013
Posts: 636

Rep: Reputation: 142Reputation: 142
you can use
Quote:
&&
and enable and disable multiple services in single command.
 
Old 08-05-2013, 03:30 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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, 06: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 06:52 AM.
 
Old 08-06-2013, 06: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, 06:41 AM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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, 07: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, 08:04 PM   #10
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
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



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

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

All times are GMT -5. The time now is 04:49 AM.

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