jueves, 7 de noviembre de 2013

LINUX-RHEL-chkconfig / systemctl

Recientemente he actualizado el S.O. de mi notebook a Fedora 19.
Después de instalar los repositorios, paquetes de software adicional, es necesario habilitar/deshabilitar los servicios en el arranque del S.O.
Acostumbrado a las versiones 4.xx de RHEL, ejecuté u chkconfig --list para conocer la configuración de arranque de los servicios, y como respuesta la consola me entrega la siguiente info

[root@Emesh ~]# chkconfig --list

Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.

      If you want to list systemd services use 'systemctl list-unit-files'.
      To see services enabled on particular target use
      'systemctl list-dependencies [target]'.

dkms_autoinstaller 0:off 1:off 2:on 3:on 4:on 5:on 6:off
ebtables       0:off 1:off 2:off 3:off 4:off 5:off 6:off
livesys         0:off 1:off 2:off 3:on 4:on 5:on 6:off
livesys-late   0:off 1:off 2:off 3:on 4:on 5:on 6:off
netconsole     0:off 1:off 2:off 3:off 4:off 5:off 6:off
network         0:off 1:off 2:off 3:off 4:off 5:off 6:off
vboxautostart-service 0:off 1:off 2:on 3:on 4:on 5:on 6:off
vboxballoonctrl-service 0:off 1:off 2:on 3:on 4:on 5:on 6:off
vboxdrv         0:off 1:off 2:on 3:on 4:on 5:on 6:off
vboxweb-service 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@Emesh ~]# 



Entonces debo utilizar el comando systemctl para conocer la configuración de arranque de los servicios del sistema.

Si ejecutamos tal cual como el mensaje indica el comando tendremos un listado completo de los servicios instalados en el S.O.
[gcepeda@Emesh ~]$ systemctl list-unit-files
UNIT FILE                                   STATE   
proc-sys-fs-binfmt_misc.automount           static  
dev-hugepages.mount                         static  
dev-mqueue.mount                            static  
proc-fs-nfsd.mount                          static  
proc-sys-fs-binfmt_misc.mount               static  
sys-fs-fuse-connections.mount               static  
sys-kernel-config.mount                     static  
sys-kernel-debug.mount                      static  
tmp.mount                                   static  
var-lib-nfs-rpc_pipefs.mount                static  
cups.path                                   enabled 
systemd-ask-password-console.path           static  
systemd-ask-password-plymouth.path          static  
systemd-ask-password-wall.path              static  
abrt-ccpp.service                           enabled 
abrt-oops.service                           enabled 
abrt-pstoreoops.service                     disabled


Para realizar operaciones de consulta, inicio, detención, habilitación, deshabilitación de un servicio ocupamos las opciones del comando:

Status
systemctl status .service

iniciar
systemctl start .service

Detener
systemctl stop .service

Reiniciar
systemctl restart .service

Habilitar en el arranque del sistema
systemctl enable .service

Deshabilitar en el arranque del sistema
systemctl disable .service


Veamos un ejemplo para el servicio de bluetooth:
[root@Emesh ~]# systemctl status bluetooth.service
bluetooth.service - Bluetooth service
   Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; disabled)
   Active: active (running) since Thu 2013-11-07 08:44:07 CLST; 1h 17min ago
 Main PID: 633 (bluetoothd)
   CGroup: name=systemd:/system/bluetooth.service
           └─633 /usr/sbin/bluetoothd -n

Nov 07 08:45:38 Emesh bluetoothd[633]: bluetoothd[633]: Unknown command complete for opcode 19
Nov 07 08:45:38 Emesh bluetoothd[633]: bluetoothd[633]: hci0: Set Discoverable (0x0006) failed: Not Powered (0x0f)
Nov 07 08:45:38 Emesh bluetoothd[633]: bluetoothd[633]: hci0: Set Powered (0x0005) failed: Busy (0x0a)
Nov 07 08:45:38 Emesh bluetoothd[633]: bluetoothd[633]: Adapter /org/bluez/633/hci0 has been enabled
Nov 07 09:56:34 Emesh bluetoothd[633]: bluetoothd[633]: Adapter /org/bluez/633/hci0 has been disabled
Nov 07 09:56:34 Emesh bluetoothd[633]: Adapter /org/bluez/633/hci0 has been disabled
Nov 07 09:56:34 Emesh bluetoothd[633]: bluetoothd[633]: Unregister path: /org/bluez/633/hci0
Nov 07 09:56:34 Emesh bluetoothd[633]: Unregister path: /org/bluez/633/hci0
Nov 07 09:56:34 Emesh bluetoothd[633]: hci0: Set IO Capability (0x0018) failed: Invalid Index (0x11)
Nov 07 09:56:34 Emesh bluetoothd[633]: bluetoothd[633]: hci0: Set IO Capability (0x0018) failed: Invalid Index (0x11)
[root@Emesh ~]# 


[root@Emesh ~]# systemctl start bluetooth.service
[root@Emesh ~]# systemctl status bluetooth.service
bluetooth.service - Bluetooth service
   Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; disabled)
   Active: active (running) since Thu 2013-11-07 10:16:34 CLST; 1s ago
 Main PID: 4166 (bluetoothd)
   CGroup: name=systemd:/system/bluetooth.service
           └─4166 /usr/sbin/bluetoothd -n

Nov 07 10:16:34 Emesh bluetoothd[4166]: Parsing /etc/bluetooth/serial.conf failed: No such file or directory
Nov 07 10:16:34 Emesh bluetoothd[4166]: Adapter /org/bluez/4166/hci0 has been enabled
Nov 07 10:16:34 Emesh bluetoothd[4166]: Unknown command complete for opcode 19
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Bluetooth daemon 4.101
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Starting SDP server
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Parsing /etc/bluetooth/input.conf failed: No such file or directory
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Bluetooth Management interface initialized
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Parsing /etc/bluetooth/serial.conf failed: No such file or directory
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Adapter /org/bluez/4166/hci0 has been enabled
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Unknown command complete for opcode 19
[root@Emesh ~]# 


[root@Emesh ~]# systemctl stop bluetooth.service
[root@Emesh ~]# systemctl status bluetooth.service
bluetooth.service - Bluetooth service
   Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; disabled)
   Active: inactive (dead) since Thu 2013-11-07 10:16:59 CLST; 1s ago
  Process: 4166 ExecStart=/usr/sbin/bluetoothd -n (code=exited, status=0/SUCCESS)

Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Bluetooth daemon 4.101
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Starting SDP server
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Parsing /etc/bluetooth/input.conf failed: No such file or directory
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Bluetooth Management interface initialized
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Parsing /etc/bluetooth/serial.conf failed: No such file or directory
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Adapter /org/bluez/4166/hci0 has been enabled
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Unknown command complete for opcode 19
Nov 07 10:16:59 Emesh systemd[1]: Stopping Bluetooth service...
Nov 07 10:16:59 Emesh bluetoothd[4166]: bluetoothd[4166]: Terminating
Nov 07 10:16:59 Emesh systemd[1]: Stopped Bluetooth service.
[root@Emesh ~]# 
[root@Emesh ~]# 
[root@Emesh ~]# 
[root@Emesh ~]# systemctl enable bluetooth.service
ln -s '/usr/lib/systemd/system/bluetooth.service' '/etc/systemd/system/dbus-org.bluez.service'
ln -s '/usr/lib/systemd/system/bluetooth.service' '/etc/systemd/system/bluetooth.target.wants/bluetooth.service'
[root@Emesh ~]# systemctl status bluetooth.service
bluetooth.service - Bluetooth service
   Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled)
   Active: inactive (dead)

Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Bluetooth daemon 4.101
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Starting SDP server
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Parsing /etc/bluetooth/input.conf failed: No such file or directory
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Bluetooth Management interface initialized
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Parsing /etc/bluetooth/serial.conf failed: No such file or directory
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Adapter /org/bluez/4166/hci0 has been enabled
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Unknown command complete for opcode 19
Nov 07 10:16:59 Emesh systemd[1]: Stopping Bluetooth service...
Nov 07 10:16:59 Emesh bluetoothd[4166]: bluetoothd[4166]: Terminating
Nov 07 10:16:59 Emesh systemd[1]: Stopped Bluetooth service.
[root@Emesh ~]# 
[root@Emesh ~]# 
[root@Emesh ~]# 
[root@Emesh ~]# systemctl disable bluetooth.service
rm '/etc/systemd/system/bluetooth.target.wants/bluetooth.service'
rm '/etc/systemd/system/dbus-org.bluez.service'
[root@Emesh ~]# systemctl status bluetooth.service
bluetooth.service - Bluetooth service
   Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; disabled)
   Active: inactive (dead)

Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Bluetooth daemon 4.101
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Starting SDP server
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Parsing /etc/bluetooth/input.conf failed: No such file or directory
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Bluetooth Management interface initialized
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Parsing /etc/bluetooth/serial.conf failed: No such file or directory
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Adapter /org/bluez/4166/hci0 has been enabled
Nov 07 10:16:34 Emesh bluetoothd[4166]: bluetoothd[4166]: Unknown command complete for opcode 19
Nov 07 10:16:59 Emesh systemd[1]: Stopping Bluetooth service...
Nov 07 10:16:59 Emesh bluetoothd[4166]: bluetoothd[4166]: Terminating
Nov 07 10:16:59 Emesh systemd[1]: Stopped Bluetooth service.
[root@Emesh ~]# 




fuente info:
http://servercomputing.blogspot.com/2011/12/systemctl-commands.html

No hay comentarios:

Publicar un comentario