Advertisement
rucinski69

Script to disable unneeded services at boot time

Nov 13th, 2018
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.61 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # Script to disable unneeded services at boot time
  4.  
  5. # Please read through each to ensure you want these disabled.
  6. # For /most/ systems, this set up is fine.
  7.  
  8. # anacron
  9. # The anacron subsystem is designed to provide cron functionality
  10. # for machines which may be shut down during the normal times that
  11. # system cron jobs run, frequently in the middle of the night.
  12. # Laptops and workstations which are shut down at night should keep
  13. # anacron enabled, so that standard system cron jobs will run when
  14. # the machine boots.
  15. chkconfig anacron off
  16. service anacron stop
  17.  
  18. # apmd
  19. # APM is being replaced by ACPI and should be considered deprecated.
  20. # As such, it can be disabled if ACPI is supported by your hardware
  21. # and kernel. If the file /proc/acpi/info exists and contains ACPI
  22. # version information, then APM can safely be disabled without loss
  23. # of functionality.
  24. chkconfig apmd off
  25. service apmd stop
  26.  
  27. # autofs
  28. # If the autofs service is not needed to dynamically mount NFS
  29. # filesystems or removable media, disable the service
  30. chkconfig autofs off
  31. service autofs stop
  32.  
  33. # avahi-daemon
  34. # The Avahi daemon implements the DNS Service Discovery and Multicast
  35. # DNS protocols, which provide service and host discovery on a network.
  36. # It allows a system to automatically identify resources on the network,
  37. # such as printers or web servers.
  38. chkconfig avahi-daemon off
  39. service avahi-daemon stop
  40.  
  41. # bluetooth
  42. # If the system requires no Bluetooth devices, disable this service
  43. chkconfig bluetooth off
  44. service bluetooth stop
  45.  
  46. # cups
  47. # Do you need the ability to print from this machine or to allow others
  48. # to print to it? If not:
  49. chkconfig cups off
  50. service cups stop
  51.  
  52. # gpm
  53. # GPM is the service that controls the text console mouse pointer.
  54. # (The X Windows mouse pointer is unaffected by this service.)
  55. chkconfig gpm off
  56. service gpm stop
  57.  
  58. # haldaemon
  59. # The haldaemon service provides a dynamic way of managing device
  60. # interfaces. It automates device configuration and provides an API for
  61. # making devices accessible to applications through the D-Bus interface.
  62. chkconfig haldaemon off
  63. service haldaemon stop
  64.  
  65. # hidd
  66. # If the system requires no Bluetooth devices, disable this service
  67. chkconfig hidd off
  68. service hidd stop
  69.  
  70. # kudzu
  71. # Kudzu, Red Hat’s hardware detection program, represents an unnecessary
  72. # security risk as it allows unprivileged users to perform hardware
  73. # configuration without authorization. Unless this specific functionality
  74. # is required, Kudzu should be disabled.
  75. chkconfig kudzu off
  76. service kudzu stop
  77.  
  78. # mcstrans
  79. # Unless there is some overriding need for the convenience of category
  80. # label translation, disable the MCS translation service
  81. chkconfig mcstrans off
  82. service mcstrans stop
  83.  
  84. # messagebus
  85. # If no services which require D-Bus are in use, disable this service
  86. chkconfig messagebus off
  87. service messagebus stop
  88.  
  89. # nfs services
  90. # If NFS is not needed, disable NFS client daemons
  91. chkconfig nfslock off
  92. service nfslock stop
  93. chkconfig rpcgssd off
  94. service rpcgssd stop
  95. chkconfig rpcidmapd off
  96. service rpcidmapd stop
  97.  
  98. # pcscd
  99. # If Smart Cards are not in use on the system, disable this service
  100. chkconfig pcscd off
  101. service pcscd stop
  102.  
  103. # portmap
  104. # No NFS, NIS?  No portmap
  105. chkconfig portmap off
  106. service portmap stop
  107.  
  108. # xfs
  109. # The system’s X.org requires the X Font Server service (xfs) to function.
  110. # The xfs service will be started auto- matically if X.org is activated
  111. # via startx. Therefore, it is safe to prevent xfs from starting at
  112. # boot when X is disabled, even if users are allowed to run X manually.
  113. chkconfig xfs off
  114. service xfs stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement