This file is indexed.

/usr/share/augeas/lenses/dist/tests/test_systemd.aug is in augeas-lenses 1.2.0-0ubuntu1.3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
(*
Module: Test_Systemd
  Provides unit tests and examples for the <Systemd> lens.
*)

module Test_Systemd =

(* Variable: desc *)
let desc = "[Unit]
Description=RPC
Description=RPC bind service
Description=RPC bind\\
service
Description= Resets System Activity Logs
"
(* Test: Systemd.lns *)
test Systemd.lns get desc =
  { "Unit"
    { "Description"
      { "value" = "RPC" }
    }
    { "Description"
      { "value" = "RPC bind service" }
    }
    { "Description"
      { "value" = "RPC bind\
service" }
    }
    { "Description"
      { "value" = "Resets System Activity Logs" }
    }
  }

(* Variable: multi *)
let multi = "[Unit]
After=syslog.target network.target
Also=canberra-system-shutdown.service canberra-system-shutdown-reboot.service
Before=sysinit.target shutdown.target
CapabilityBoundingSet=CAP_SYS_ADMIN CAP_SETUID CAP_SETGID
Conflicts=emergency.service emergency.target
ControlGroup=%R/user/%I/shared cpu:/
ListenNetlink=kobject-uevent 1
Requires=shutdown.target umount.target final.target
Sockets=udev-control.socket udev-kernel.socket
WantedBy=halt.target poweroff.target
Wants=local-fs.target swap.target
Wants=local-fs.target \
swap.target
Wants=local-fs.target\
swap.target
Wants= local-fs.target
"
(* Test: Systemd.lns *)
test Systemd.lns get multi =
  { "Unit"
    { "After"
      { "value" = "syslog.target" }
      { "value" = "network.target" }
    }
    { "Also"
      { "value" = "canberra-system-shutdown.service" }
      { "value" = "canberra-system-shutdown-reboot.service" }
    }
    { "Before"
      { "value" = "sysinit.target" }
      { "value" = "shutdown.target" }
    }
    { "CapabilityBoundingSet"
      { "value" = "CAP_SYS_ADMIN" }
      { "value" = "CAP_SETUID" }
      { "value" = "CAP_SETGID" }
    }
    { "Conflicts"
      { "value" = "emergency.service" }
      { "value" = "emergency.target" }
    }
    { "ControlGroup"
      { "value" = "%R/user/%I/shared" }
      { "value" = "cpu:/" }
    }
    { "ListenNetlink"
      { "value" = "kobject-uevent" }
      { "value" = "1" }
    }
    { "Requires"
      { "value" = "shutdown.target" }
      { "value" = "umount.target" }
      { "value" = "final.target" }
    }
    { "Sockets"
      { "value" = "udev-control.socket" }
      { "value" = "udev-kernel.socket" }
    }
    { "WantedBy"
      { "value" = "halt.target" }
      { "value" = "poweroff.target" }
    }
    { "Wants"
      { "value" = "local-fs.target" }
      { "value" = "swap.target" }
    }
    { "Wants"
      { "value" = "local-fs.target" }
      { "value" = "swap.target" }
    }
    { "Wants"
      { "value" = "local-fs.target" }
      { "value" = "swap.target" }
    }
    { "Wants"
      { "value" = "local-fs.target" }
    }
  }

(* Variable: exec *)
let exec = "[Service]
ExecStart=/bin/ls
ExecReload=/bin/kill -USR1 $MAINPID
ExecStart=/sbin/rpcbind -w
ExecStartPost=/bin/systemctl disable firstboot-graphical.service firstboot-text.service
ExecStartPre=/sbin/modprobe -qa $SUPPORTED_DRIVERS
ExecStop=/usr/sbin/aiccu stop
ExecStopPost=-/bin/systemctl poweroff
ExecStopPost=@/bin/systemctl poweroff
ExecStopPost=-@/bin/systemctl poweroff
ExecStopPost=/bin/systemctl\
poweroff
"
(* Test: Systemd.lns *)
test Systemd.lns get exec =
  { "Service"
    { "ExecStart"
      { "command" = "/bin/ls" }
    }
    { "ExecReload"
      { "command" = "/bin/kill" }
      { "arguments"
        { "1" = "-USR1" }
        { "2" = "$MAINPID" }
      }
    }
    { "ExecStart"
      { "command" = "/sbin/rpcbind" }
      { "arguments"
        { "1" = "-w" }
      }
    }
    { "ExecStartPost"
      { "command" = "/bin/systemctl" }
      { "arguments"
        { "1" = "disable" }
        { "2" = "firstboot-graphical.service" }
        { "3" = "firstboot-text.service" }
      }
    }
    { "ExecStartPre"
      { "command" = "/sbin/modprobe" }
      { "arguments"
        { "1" = "-qa" }
        { "2" = "$SUPPORTED_DRIVERS" }
      }
    }
    { "ExecStop"
      { "command" = "/usr/sbin/aiccu" }
      { "arguments"
        { "1" = "stop" }
      }
    }
    { "ExecStopPost"
      { "ignoreexit" }
      { "command" = "/bin/systemctl" }
      { "arguments"
        { "1" = "poweroff" }
      }
    }
    { "ExecStopPost"
      { "arg0" }
      { "command" = "/bin/systemctl" }
      { "arguments"
        { "1" = "poweroff" }
      }
    }
    { "ExecStopPost"
      { "ignoreexit" }
      { "arg0" }
      { "command" = "/bin/systemctl" }
      { "arguments"
        { "1" = "poweroff" }
      }
    }
    { "ExecStopPost"
      { "command" = "/bin/systemctl" }
      { "arguments"
        { "1" = "poweroff" }
      }
    }
  }

(* Variable: env *)
let env = "[Service]
Environment=LANG=C
Environment=LANG=C FOO=BAR
Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION=
Environment=LANG=C\
FOO=BAR
"
(* Test: Systemd.lns *)
test Systemd.lns get env =
  { "Service"
    { "Environment"
      { "LANG" = "C" }
    }
    { "Environment"
      { "LANG" = "C" }
      { "FOO" = "BAR" }
    }
    { "Environment"
      { "LANG" }
      { "LANGUAGE" }
      { "LC_CTYPE" }
      { "LC_NUMERIC" }
      { "LC_TIME" }
      { "LC_COLLATE" }
      { "LC_MONETARY" }
      { "LC_MESSAGES" }
      { "LC_PAPER" }
      { "LC_NAME" }
      { "LC_ADDRESS" }
      { "LC_TELEPHONE" }
      { "LC_MEASUREMENT" }
      { "LC_IDENTIFICATION" }
    }
    { "Environment"
      { "LANG" = "C" }
      { "FOO" = "BAR" }
    }
  }

(* Variable: unit *)
let unit = "#  This file is part of systemd.
#

# See systemd.special(7) for details

.include /etc/example

[Unit]
Description=Locale Service
# Add another file
.include /etc/example

[Service]
ExecStart=/lib/systemd/systemd-localed
Type=dbus
BusName=org.freedesktop.locale1
CapabilityBoundingSet=

"
(* Test: Systemd.lns *)
test Systemd.lns get unit =
  { "#comment" = "This file is part of systemd." }
  {}
  {  }
  { "#comment" = "See systemd.special(7) for details" }
  {  }
  { ".include" = "/etc/example" }
  {  }
  { "Unit"
    { "Description"
      { "value" = "Locale Service" }
    }
    { "#comment" = "Add another file" }
    { ".include" = "/etc/example" }
    {  }
  }
  { "Service"
    { "ExecStart"
      { "command" = "/lib/systemd/systemd-localed" }
    }
    { "Type"
      { "value" = "dbus" }
    }
    { "BusName"
      { "value" = "org.freedesktop.locale1" }
    }
    { "CapabilityBoundingSet" }
    {  }
  }

(* Test: Systemd.lns
     Values can contain backslashes *)
test Systemd.entry_command get "ExecStart=/usr/bin/find /var/lib/sudo -exec /usr/bin/touch -t 198501010000 '{}' \073\n" =
  { "ExecStart"
    { "command" = "/usr/bin/find" }
    { "arguments"
      { "1" = "/var/lib/sudo" }
      { "2" = "-exec" }
      { "3" = "/usr/bin/touch" }
      { "4" = "-t" }
      { "5" = "198501010000" }
      { "6" = "'{}'" }
      { "7" = "\073" }
    }
  }