systemd: how to list enabled services

Ian Pilcher arequipeno at gmail.com
Sun Mar 27 14:54:50 UTC 2011


On 03/27/2011 06:26 AM, Henk Breimer wrote:
> 
> Nobody seems to have found systemadm!
> Does it all
> 

Maybe I'm missing it, but I don't see any way to enable/disable services
in systemadm.

I finally settled on the following to list the status of all services:

#!/bin/bash

for SERVICE in `systemctl -t service --full --all list-units | awk '{
print $1 }'`; do
    echo -n "$SERVICE:  "
    if systemctl is-enabled $SERVICE; then
        echo ENABLED
    else
        echo disabled
    fi
done 2>/dev/null

-- 
========================================================================
Ian Pilcher                                         arequipeno at gmail.com
"If you're going to shift my paradigm ... at least buy me dinner first."
========================================================================



More information about the test mailing list