0% found this document useful (0 votes)
62 views4 pages

Reiniciar Servisios de Red Hat o Centos

The document discusses how to manage services in Red Hat Enterprise Linux 7 and CentOS 7 using the systemctl command. It explains that RHEL 7 and CentOS 7 use systemd instead of the traditional init scripts and service command. The key points are: - To view running services, use "systemctl" without parameters - To view all services including stopped ones, use "systemctl list-unit-files" - To check the status of a service, use "systemctl status service_name.service" - To start, stop or restart a service use "systemctl start service_name.service", "systemctl stop service_name.service" and "systemctl restart service_

Uploaded by

Byron
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views4 pages

Reiniciar Servisios de Red Hat o Centos

The document discusses how to manage services in Red Hat Enterprise Linux 7 and CentOS 7 using the systemctl command. It explains that RHEL 7 and CentOS 7 use systemd instead of the traditional init scripts and service command. The key points are: - To view running services, use "systemctl" without parameters - To view all services including stopped ones, use "systemctl list-unit-files" - To check the status of a service, use "systemctl status service_name.service" - To start, stop or restart a service use "systemctl start service_name.service", "systemctl stop service_name.service" and "systemctl restart service_

Uploaded by

Byron
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Arrancar /Parar o Reiniciar servicios en Rhel 7 y Centos 7

En RHEL 7 y CentOS 7 (ver gua de instalacin)la forma de controlar los


servicios del sistema cambia completamente. Pasamos del uso del
comando service y de la control de servicios a travs de /etc/init.d a
la gestin a travs del service manager systemctl.

La explicacin la tenemos directamente en el fichero README de


/etc/init.d:

# more /etc/init.d/README
You are looking for the traditional init scripts in /etc/rc.d/init.d,
and they are gone?

Here's an explanation on what's going on:

You are running a systemd-based OS where traditional init scripts have


been replaced by native systemd services files. Service files provide
very similar functionality to init scripts. To make use of service
files simply invoke "systemctl", which will output a list of all
currently running services (and other units). Use "systemctl
list-unit-files" to get a listing of all known unit files, including
stopped, disabled and masked ones. Use "systemctl start
foobar.service" and "systemctl stop foobar.service" to start or stop a
service, respectively. For further details, please refer to
systemctl(1).

Note that traditional init scripts continue to function on a systemd


system. An init script /etc/rc.d/init.d/foobar is implicitly mapped
into a service unit foobar.service during system initialization.

Thank you!

Further reading:
man:systemctl(1)
man:systemd(1)
http://0pointer.de/blog/projects/systemd-for-admins-3.html
http://www.freedesktop.org/wiki/Software/systemd/Incompatibilities

Vamos a ver entonces los comandos bsicos de gestin de servicios


con systemctl.

Listar servicios del sistema


El comando systemctl sin parmetros nos mostrar el listado de todos
los servicios del sistema, incluyendo los que estn activos,
parados o en estado fallido.

# systemctl
UNIT LOAD ACTIVE SUB DESCRIPTION
proc-sys-fs-binfmt_misc.automount loaded active waiting Arbitrary
Executable File Formats File System Automo
sys-devices-pci0...et1:0:0-1:0:0:0-block-sr0.device loaded active plugged VBOX_CD-
ROM
sys-devices-pci0...0-0000:00:03.0-net-enp0s3.device loaded active plugged PRO/1000
MT Desktop Adapter
sys-devices-pci0...-0000:00:05.0-sound-card0.device loaded active plugged 82801AA
AC'97 Audio Controller
sys-devices-pci0...:0-2:0:0:0-block-sda-sda1.device loaded active plugged
VBOX_HARDDISK
sys-devices-pci0...:0-2:0:0:0-block-sda-sda2.device loaded active plugged LVM PV
F3zoLx-uSaP-faJK-Vhz7-iJC4-XFml-QjX37E on /de
sys-devices-pci0...et2:0:0-2:0:0:0-block-sda.device loaded active plugged
VBOX_HARDDISK

Los servicios son llamados UNITS, y como veis podemos visualizar el


estado del proceso, si est cargado en el sistema, descripcin

El parmetro list-units muestra la misma informacin:

# systemctl list-units

Ver estado de un servicio


Tan sencillo como pasar el parmetro status + el servicio. Vamos a ver
el estado del firewall:
# systemctl status firewalld.service
firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)
Active: active (running) since sb 2014-08-23 17:51:42 CEST; 9min ago
Main PID: 549 (firewalld)
CGroup: /system.slice/firewalld.service
549 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

ago 23 17:51:42 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall


daemon.

Como podis observar nos ofrece mucha ms informacin que el tpico status
que tenamos en init.d y service. Incluso podemos ver el log completo o
slo la parte que engloba el arranque:

# systemctl status network.service


network.service - LSB: Bring up/down networking
Loaded: loaded (/etc/rc.d/init.d/network)
Active: active (exited) since sb 2014-08-23 17:51:45 CEST; 10min ago
Process: 830 ExecStart=/etc/rc.d/init.d/network start (code=exited,
status=0/SUCCESS)

ago 23 17:51:43 localhost.localdomain systemd[1]: Starting LSB: Bring up/down


networking...
ago 23 17:51:44 localhost.localdomain network[830]: Bringing up loopback interface:
Could not load file '/etc/sysconfig...g-lo'
ago 23 17:51:44 localhost.localdomain network[830]: Could not load file
'/etc/sysconfig/network-scripts/ifcfg-lo'
ago 23 17:51:44 localhost.localdomain network[830]: Could not load file
'/etc/sysconfig/network-scripts/ifcfg-lo'
ago 23 17:51:44 localhost.localdomain network[830]: Could not load file
'/etc/sysconfig/network-scripts/ifcfg-lo'
ago 23 17:51:44 localhost.localdomain network[830]: [ OK ]
ago 23 17:51:45 localhost.localdomain network[830]: Bringing up interface enp0s3:
[ OK ]
ago 23 17:51:45 localhost.localdomain systemd[1]: Started LSB: Bring up/down
networking.
Hint: Some lines were ellipsized, use -l to show in full.
Arrancar, parar y reiniciar servicios
Ya sabemos los servicios que hay en el sistema, as que podemos
invocarlos para iniciarlos, pararlos o reiniciarlos:

Iniciar servicio:

# systemctl start firewalld.service

Parar servicio:

# systemctl stop firewalld.service

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy