~mvo/snappy/15.04-lp1490574-systemd-type-forking

« back to all changes in this revision

Viewing changes to debian/ubuntu-core-snappy.cache-lsblk.service

  • Committer: Michael Vogt
  • Date: 2015-02-06 10:23:37 UTC
  • mto: (148.1.5 snappy)
  • mto: This revision was merged to the branch mainline in revision 150.
  • Revision ID: michael.vogt@ubuntu.com-20150206102337-j812czic4jriv290
add COPYING, remove debian/ubuntu-core-snappy.cache-lsblk.service, rename snappy->snappy-go and remove conflict

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
#---------------------------------------------------------------------
12
 
 
13
 
[Unit]
14
 
Description=Generate lsblk output for snappy
15
 
 
16
 
[Service]
17
 
Type=oneshot
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
21
 
 
22
 
[Install]
23
 
WantedBy=local-fs.target