~ubuntu-branches/ubuntu/saucy/systemd/saucy-proposed

« back to all changes in this revision

Viewing changes to debian/debian-enable-units

  • Committer: Package Import Robot
  • Author(s): Michael Biebl
  • Date: 2013-02-15 17:01:24 UTC
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: package-import@ubuntu.com-20130215170124-pohfk2t6u6ia3q1n
Tags: 44-10
* Team upload.
* Using the return code of "systemctl is-enabled" to determine whether we
  enable a service or not is unreliable since it also returns a non-zero
  exit code for masked services. As we don't want to enable masked services,
  grep for the string "disabled" instead.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
# Get entries which need to be enabled
34
34
needs_enable=$(mktemp)
35
35
while read unit ; do
36
 
    systemctl is-enabled "$unit" >/dev/null || echo "$unit" >> $needs_enable
 
36
    if systemctl is-enabled "$unit" 2> /dev/null | grep -q "disabled"; then
 
37
        echo "$unit" >> $needs_enable
 
38
    fi
37
39
done < $installed
38
40
 
39
41