Skip to content
TheChatArchiveThe Chat Archive
gpt-4o-mini-2024-07-18· OpenAIAi2 WildChat-4.8M (AI2)

how to get list of running services on sles 15

  1. User

    how to get list of running services on sles 15

  2. Assistant

    To get a list of running services on SUSE Linux Enterprise Server (SLES) 15, you can use the systemctl command, which is part of systemd, the init system used by SLES 15.

    Here are a few commands you can use:

    1. List all running services:

      systemctl list-units --type=service --state=running
      
    2. List all services (including inactive ones):

      systemctl list-units --type=service
      
    3. Get the status of a specific service: If you want to check the status of a specific service, you can use:

      systemctl status <service-name>
      
    4. Get a summary of all services: To view a summary of all services and their states, you can use:

      systemctl --type=service
      
    5. Check enabled services: If you're interested in services that are enabled to start at boot:

      systemctl list-unit-files --type=service --state=enabled
      

    These commands should provide you with detailed information about the running services on your SLES 15 system.

  3. User

    how to restart service on sles 15

  4. Assistant

    To restart a service on SUSE Linux Enterprise Server (SLES) 15, you can use the systemctl command, which is part of the systemd init system. Here’s how you can do it:

    1. Restart a specific service: Use the following command, replacing <service-name> with the name of the service you want to restart:

      sudo systemctl restart <service-name>
      

      For example, to restart the httpd service (Apache), you would run:

      sudo systemctl restart httpd
      
    2. Check the status of the service (optional): After restarting the service, you might want to check its status to ensure that it has restarted successfully:

      sudo systemctl status <service-name>
      
    3. Enable a service to start on boot (if needed): If you want to make sure that the service starts automatically on boot, you can enable it:

      sudo systemctl enable <service-name>
      

    Example

    Here’s a complete example for restarting the ssh service:

    sudo systemctl restart sshd
    sudo systemctl status sshd
    

    Make sure you have the necessary privileges (typically root or sudo access) to perform these operations.