~ubuntu-core-dev/update-notifier/ubuntu

« back to all changes in this revision

Viewing changes to data/package-system-locked

  • Committer: Andrea Azzarone
  • Date: 2019-03-13 10:05:20 UTC
  • mto: This revision was merged to the branch mainline in revision 956.
  • Revision ID: azzaronea@gmail.com-20190313100520-024zyxvlpm81vgrq
Add livepatch status icons.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# check if package system is locked
 
3
# return 0 if unlocked, 2 if locked, 1 on error
 
4
set -e
 
5
 
 
6
for f in /var/lib/dpkg/lock /var/cache/apt/archives/lock \
 
7
    /var/lib/apt/lists/lock /run/unattended-upgrades.lock; do
 
8
    [ -e $f ] || continue
 
9
 
 
10
    # fuser succeeds if there is at least one user
 
11
    if fuser $f; then
 
12
        exit 2
 
13
    fi
 
14
done
 
15
 
 
16
exit 0