1
#---------------------------------------------------------------------
2
# Unfortunately, the lsblk(8) command requires root privileges to allow
3
# it to query the disk partition labels. Worse, if run as a non-priv
4
# user, it simply display the information that it can query without
5
# error and exits zero! Since snappy needs to run lsblk but does not
6
# want to have to require the user be root in all cases, this unit
7
# generate the lsblk output for snappy to consume. This isn't ideal, but
8
# does avoid having to use set-uid helpers. Added to which, although the
9
# generated file is essentially a static cache, the partition labels are
10
# not expected to change.
11
#---------------------------------------------------------------------
14
Description=Generate lsblk output for snappy
18
ExecStartPre=/bin/mkdir -m 0755 -p /run/snappy
19
ExecStart=/bin/sh -c '/bin/lsblk --ascii --pairs --output=NAME,LABEL,PKNAME,MOUNTPOINT > /run/snappy/lsblk.txt'
20
ExecStartPost=/bin/chmod 644 /run/snappy/lsblk.txt
23
WantedBy=local-fs.target