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

« back to all changes in this revision

Viewing changes to data/package-system-locked

  • Committer: Balint Reczey
  • Date: 2020-06-11 18:46:02 UTC
  • Revision ID: balint.reczey@canonical.com-20200611184602-2rv1zan3xu723x2u
Moved to git at https://git.launchpad.net/update-notifier

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