@enjoys/context-engine 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/commands/journalctl.json +203 -66
- package/data/commands/manifest.json +6 -2
- package/data/commands/systemctl.json +800 -23
- package/data/commands/systemd-analyze.json +239 -0
- package/data/commands/zsh.json +166 -0
- package/data/completion/nginx.json +561 -77
- package/data/completion/systemd.json +795 -47
- package/data/completion/zsh.json +829 -70
- package/data/defination/nginx.json +416 -32
- package/data/defination/systemd.json +538 -56
- package/data/defination/zsh.json +323 -86
- package/data/hover/nginx.json +59 -17
- package/data/hover/systemd.json +42 -7
- package/data/hover/zsh.json +44 -9
- package/package.json +2 -2
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"kind": 15,
|
|
7
7
|
"detail": "Unit section",
|
|
8
8
|
"documentation": {
|
|
9
|
-
"value": "Generic
|
|
9
|
+
"value": "Generic unit metadata and dependencies."
|
|
10
10
|
},
|
|
11
|
-
"insertText": "[Unit]\nDescription=${1:My Service}\
|
|
11
|
+
"insertText": "[Unit]\nDescription=${1:My Service}\nDocumentation=${2:https://example.com}\nAfter=${3:network-online.target}\nWants=${4:network-online.target}",
|
|
12
12
|
"insertTextRules": 4,
|
|
13
13
|
"sortText": "00_unit"
|
|
14
14
|
},
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"documentation": {
|
|
20
20
|
"value": "Service-specific configuration."
|
|
21
21
|
},
|
|
22
|
-
"insertText": "[Service]\nType=${1:simple}\nUser=${2:www-data}\
|
|
22
|
+
"insertText": "[Service]\nType=${1:simple}\nUser=${2:www-data}\nGroup=${3:www-data}\nWorkingDirectory=${4:/opt/app}\nExecStart=${5:/usr/bin/app}\nRestart=${6:on-failure}\nRestartSec=${7:5}",
|
|
23
23
|
"insertTextRules": 4,
|
|
24
24
|
"sortText": "00_service"
|
|
25
25
|
},
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"kind": 15,
|
|
29
29
|
"detail": "Install section",
|
|
30
30
|
"documentation": {
|
|
31
|
-
"value": "Installation
|
|
31
|
+
"value": "Installation targets for enable/disable."
|
|
32
32
|
},
|
|
33
33
|
"insertText": "[Install]\nWantedBy=${1:multi-user.target}",
|
|
34
34
|
"insertTextRules": 4,
|
|
@@ -39,132 +39,880 @@
|
|
|
39
39
|
"kind": 15,
|
|
40
40
|
"detail": "Timer section",
|
|
41
41
|
"documentation": {
|
|
42
|
-
"value": "Timer
|
|
42
|
+
"value": "Timer-based activation."
|
|
43
43
|
},
|
|
44
|
-
"insertText": "[Timer]\nOnCalendar=${1:*-*-* 00:00:00}\nPersistent
|
|
44
|
+
"insertText": "[Timer]\nOnCalendar=${1:*-*-* 00:00:00}\nPersistent=${2:true}\nUnit=${3:myservice.service}\n\n[Install]\nWantedBy=timers.target",
|
|
45
45
|
"insertTextRules": 4,
|
|
46
46
|
"sortText": "00_timer"
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
|
-
"label": "
|
|
49
|
+
"label": "[Socket]",
|
|
50
50
|
"kind": 15,
|
|
51
|
-
"detail": "
|
|
51
|
+
"detail": "Socket section",
|
|
52
52
|
"documentation": {
|
|
53
|
-
"value": "
|
|
53
|
+
"value": "Socket-based activation."
|
|
54
54
|
},
|
|
55
|
-
"insertText": "[
|
|
55
|
+
"insertText": "[Socket]\nListenStream=${1:/run/myapp.sock}\nSocketUser=${2:www-data}\nSocketGroup=${3:www-data}\nSocketMode=${4:0660}\n\n[Install]\nWantedBy=sockets.target",
|
|
56
56
|
"insertTextRules": 4,
|
|
57
|
-
"sortText": "
|
|
57
|
+
"sortText": "00_socket"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"label": "[Path]",
|
|
61
|
+
"kind": 15,
|
|
62
|
+
"detail": "Path section",
|
|
63
|
+
"documentation": {
|
|
64
|
+
"value": "Path-based activation."
|
|
65
|
+
},
|
|
66
|
+
"insertText": "[Path]\nPathExists=${1:/var/spool/myapp/trigger}\nUnit=${2:myapp-process.service}\n\n[Install]\nWantedBy=multi-user.target",
|
|
67
|
+
"insertTextRules": 4,
|
|
68
|
+
"sortText": "00_path"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"label": "[Mount]",
|
|
72
|
+
"kind": 15,
|
|
73
|
+
"detail": "Mount section",
|
|
74
|
+
"documentation": {
|
|
75
|
+
"value": "Mount point configuration."
|
|
76
|
+
},
|
|
77
|
+
"insertText": "[Mount]\nWhat=${1:/dev/sdb1}\nWhere=${2:/mnt/data}\nType=${3:ext4}\nOptions=${4:defaults,noatime}\n\n[Install]\nWantedBy=multi-user.target",
|
|
78
|
+
"insertTextRules": 4,
|
|
79
|
+
"sortText": "00_mount"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"label": "[Swap]",
|
|
83
|
+
"kind": 15,
|
|
84
|
+
"detail": "Swap section",
|
|
85
|
+
"documentation": {
|
|
86
|
+
"value": "Swap device configuration."
|
|
87
|
+
},
|
|
88
|
+
"insertText": "[Swap]\nWhat=${1:/swapfile}\n\n[Install]\nWantedBy=swap.target",
|
|
89
|
+
"insertTextRules": 4,
|
|
90
|
+
"sortText": "00_swap"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"label": "[Slice]",
|
|
94
|
+
"kind": 15,
|
|
95
|
+
"detail": "Slice section",
|
|
96
|
+
"documentation": {
|
|
97
|
+
"value": "Resource control slice."
|
|
98
|
+
},
|
|
99
|
+
"insertText": "[Slice]\nCPUQuota=${1:50%}\nMemoryMax=${2:2G}\nIOWeight=${3:100}",
|
|
100
|
+
"insertTextRules": 4,
|
|
101
|
+
"sortText": "00_slice"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"label": "service simple",
|
|
105
|
+
"kind": 15,
|
|
106
|
+
"detail": "Simple service unit",
|
|
107
|
+
"documentation": {
|
|
108
|
+
"value": "Complete simple (foreground) service unit file."
|
|
109
|
+
},
|
|
110
|
+
"insertText": "[Unit]\nDescription=${1:My Application}\nAfter=network-online.target\nWants=network-online.target\n\n[Service]\nType=simple\nUser=${2:appuser}\nGroup=${2:appuser}\nWorkingDirectory=${3:/opt/app}\nExecStart=${4:/opt/app/bin/server}\nRestart=on-failure\nRestartSec=5\nStartLimitBurst=3\nStartLimitIntervalSec=60\n\nEnvironment=NODE_ENV=production\n# EnvironmentFile=/opt/app/.env\n\nStandardOutput=journal\nStandardError=journal\nSyslogIdentifier=${1:my-app}\n\n[Install]\nWantedBy=multi-user.target",
|
|
111
|
+
"insertTextRules": 4,
|
|
112
|
+
"sortText": "01_svc_simple"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"label": "service exec",
|
|
116
|
+
"kind": 15,
|
|
117
|
+
"detail": "Exec service",
|
|
118
|
+
"documentation": {
|
|
119
|
+
"value": "Service Type=exec — ready after binary starts."
|
|
120
|
+
},
|
|
121
|
+
"insertText": "[Unit]\nDescription=${1:My Service}\nAfter=network-online.target\nWants=network-online.target\n\n[Service]\nType=exec\nUser=${2:app}\nGroup=${2:app}\nWorkingDirectory=${3:/opt/app}\nExecStart=${4:/opt/app/start.sh}\nRestart=always\nRestartSec=5\n\n[Install]\nWantedBy=multi-user.target",
|
|
122
|
+
"insertTextRules": 4,
|
|
123
|
+
"sortText": "01_svc_exec"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"label": "service forking",
|
|
127
|
+
"kind": 15,
|
|
128
|
+
"detail": "Forking daemon",
|
|
129
|
+
"documentation": {
|
|
130
|
+
"value": "For traditional daemons that fork to background."
|
|
131
|
+
},
|
|
132
|
+
"insertText": "[Unit]\nDescription=${1:Forking Daemon}\nAfter=network.target\n\n[Service]\nType=forking\nPIDFile=${2:/var/run/mydaemon.pid}\nExecStart=${3:/usr/sbin/mydaemon -d}\nExecReload=/bin/kill -HUP \\$MAINPID\nExecStop=/bin/kill -TERM \\$MAINPID\nRestart=on-failure\n\n[Install]\nWantedBy=multi-user.target",
|
|
133
|
+
"insertTextRules": 4,
|
|
134
|
+
"sortText": "01_svc_forking"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"label": "service notify",
|
|
138
|
+
"kind": 15,
|
|
139
|
+
"detail": "Notify service",
|
|
140
|
+
"documentation": {
|
|
141
|
+
"value": "Service that sends sd_notify() when ready."
|
|
142
|
+
},
|
|
143
|
+
"insertText": "[Unit]\nDescription=${1:Notify Service}\nAfter=network-online.target\n\n[Service]\nType=notify\nUser=${2:app}\nExecStart=${3:/opt/app/bin/server}\nWatchdogSec=${4:30}\nRestart=on-failure\nNotifyAccess=main\n\n[Install]\nWantedBy=multi-user.target",
|
|
144
|
+
"insertTextRules": 4,
|
|
145
|
+
"sortText": "01_svc_notify"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"label": "service oneshot",
|
|
149
|
+
"kind": 15,
|
|
150
|
+
"detail": "Oneshot service",
|
|
151
|
+
"documentation": {
|
|
152
|
+
"value": "Run-once service (scripts, setup tasks)."
|
|
153
|
+
},
|
|
154
|
+
"insertText": "[Unit]\nDescription=${1:Setup Task}\nAfter=${2:network-online.target}\n\n[Service]\nType=oneshot\nExecStart=${3:/opt/scripts/setup.sh}\nRemainAfterExit=${4:yes}\nStandardOutput=journal\n\n[Install]\nWantedBy=multi-user.target",
|
|
155
|
+
"insertTextRules": 4,
|
|
156
|
+
"sortText": "01_svc_oneshot"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"label": "Node.js service",
|
|
160
|
+
"kind": 15,
|
|
161
|
+
"detail": "Node.js app",
|
|
162
|
+
"documentation": {
|
|
163
|
+
"value": "Production Node.js service unit."
|
|
164
|
+
},
|
|
165
|
+
"insertText": "[Unit]\nDescription=${1:Node.js Application}\nAfter=network-online.target\nWants=network-online.target\n\n[Service]\nType=simple\nUser=${2:nodeapp}\nGroup=${2:nodeapp}\nWorkingDirectory=${3:/opt/nodeapp}\nExecStart=/usr/bin/node ${4:dist/server.js}\nRestart=always\nRestartSec=5\nStartLimitBurst=5\nStartLimitIntervalSec=60\n\nEnvironment=NODE_ENV=production\nEnvironment=PORT=${5:3000}\n# EnvironmentFile=/opt/nodeapp/.env\n\nStandardOutput=journal\nStandardError=journal\nSyslogIdentifier=${1:nodeapp}\n\n# Security\nNoNewPrivileges=true\nProtectSystem=strict\nProtectHome=true\nReadWritePaths=/opt/nodeapp/data\n\n[Install]\nWantedBy=multi-user.target",
|
|
166
|
+
"insertTextRules": 4,
|
|
167
|
+
"sortText": "01_svc_nodejs"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"label": "Python service",
|
|
171
|
+
"kind": 15,
|
|
172
|
+
"detail": "Python/Gunicorn",
|
|
173
|
+
"documentation": {
|
|
174
|
+
"value": "Python application service with gunicorn."
|
|
175
|
+
},
|
|
176
|
+
"insertText": "[Unit]\nDescription=${1:Python Application}\nAfter=network-online.target\nWants=network-online.target\n\n[Service]\nType=notify\nUser=${2:pyapp}\nGroup=${2:pyapp}\nWorkingDirectory=${3:/opt/pyapp}\nExecStart=${4:/opt/pyapp/venv/bin/gunicorn -w 4 -b 0.0.0.0:8000 app:application}\nExecReload=/bin/kill -HUP \\$MAINPID\nRestart=on-failure\nRestartSec=5\n\nEnvironment=PYTHONUNBUFFERED=1\nEnvironmentFile=/opt/pyapp/.env\n\nStandardOutput=journal\nStandardError=journal\nSyslogIdentifier=${1:pyapp}\n\nNoNewPrivileges=true\nProtectSystem=strict\nProtectHome=true\nReadWritePaths=/opt/pyapp/data\n\n[Install]\nWantedBy=multi-user.target",
|
|
177
|
+
"insertTextRules": 4,
|
|
178
|
+
"sortText": "01_svc_python"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"label": "Go service",
|
|
182
|
+
"kind": 15,
|
|
183
|
+
"detail": "Go binary",
|
|
184
|
+
"documentation": {
|
|
185
|
+
"value": "Go compiled binary service."
|
|
186
|
+
},
|
|
187
|
+
"insertText": "[Unit]\nDescription=${1:Go Service}\nAfter=network-online.target\n\n[Service]\nType=simple\nUser=${2:goapp}\nGroup=${2:goapp}\nExecStart=${3:/usr/local/bin/myapp}\nRestart=always\nRestartSec=5\n\nEnvironmentFile=${4:/etc/myapp/config.env}\n\nNoNewPrivileges=true\nProtectSystem=strict\nProtectHome=true\nPrivateTmp=true\n\n[Install]\nWantedBy=multi-user.target",
|
|
188
|
+
"insertTextRules": 4,
|
|
189
|
+
"sortText": "01_svc_go"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"label": "Docker container service",
|
|
193
|
+
"kind": 15,
|
|
194
|
+
"detail": "Docker container",
|
|
195
|
+
"documentation": {
|
|
196
|
+
"value": "Run a Docker container as a systemd service."
|
|
197
|
+
},
|
|
198
|
+
"insertText": "[Unit]\nDescription=${1:Docker Container}\nRequires=docker.service\nAfter=docker.service\n\n[Service]\nType=simple\nRestart=always\nRestartSec=5\nExecStartPre=-/usr/bin/docker stop ${2:mycontainer}\nExecStartPre=-/usr/bin/docker rm ${2:mycontainer}\nExecStart=/usr/bin/docker run --rm --name ${2:mycontainer} \\\n -p ${3:8080}:${4:80} \\\n ${5:nginx:latest}\nExecStop=/usr/bin/docker stop ${2:mycontainer}\n\n[Install]\nWantedBy=multi-user.target",
|
|
199
|
+
"insertTextRules": 4,
|
|
200
|
+
"sortText": "01_svc_docker"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"label": "timer daily",
|
|
204
|
+
"kind": 15,
|
|
205
|
+
"detail": "Daily timer",
|
|
206
|
+
"documentation": {
|
|
207
|
+
"value": "Timer that fires once daily."
|
|
208
|
+
},
|
|
209
|
+
"insertText": "[Unit]\nDescription=Daily ${1:backup} timer\n\n[Timer]\nOnCalendar=*-*-* ${2:02:00:00}\nPersistent=true\nRandomizedDelaySec=${3:300}\n\n[Install]\nWantedBy=timers.target",
|
|
210
|
+
"insertTextRules": 4,
|
|
211
|
+
"sortText": "02_timer_daily"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"label": "timer interval",
|
|
215
|
+
"kind": 15,
|
|
216
|
+
"detail": "Interval timer",
|
|
217
|
+
"documentation": {
|
|
218
|
+
"value": "Timer that fires at regular intervals."
|
|
219
|
+
},
|
|
220
|
+
"insertText": "[Unit]\nDescription=${1:Periodic task} timer\n\n[Timer]\nOnBootSec=${2:5min}\nOnUnitActiveSec=${3:15min}\nAccuracySec=${4:1min}\n\n[Install]\nWantedBy=timers.target",
|
|
221
|
+
"insertTextRules": 4,
|
|
222
|
+
"sortText": "02_timer_interval"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"label": "timer weekly",
|
|
226
|
+
"kind": 15,
|
|
227
|
+
"detail": "Weekly timer",
|
|
228
|
+
"documentation": {
|
|
229
|
+
"value": "Timer that fires once per week."
|
|
230
|
+
},
|
|
231
|
+
"insertText": "[Unit]\nDescription=Weekly ${1:maintenance} timer\n\n[Timer]\nOnCalendar=Mon *-*-* ${2:03:00:00}\nPersistent=true\n\n[Install]\nWantedBy=timers.target",
|
|
232
|
+
"insertTextRules": 4,
|
|
233
|
+
"sortText": "02_timer_weekly"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"label": "timer cron-like",
|
|
237
|
+
"kind": 15,
|
|
238
|
+
"detail": "Cron-like timer",
|
|
239
|
+
"documentation": {
|
|
240
|
+
"value": "Timer using cron-like OnCalendar expressions."
|
|
241
|
+
},
|
|
242
|
+
"insertText": "# OnCalendar format: DayOfWeek Year-Month-Day Hour:Minute:Second\n# Examples:\n# *-*-* *:00:00 = every hour\n# *-*-* *:*:00 = every minute\n# Mon *-*-* 09:00:00 = every Monday 9am\n# *-*-01 00:00:00 = 1st of each month\n# quarterly = Jan,Apr,Jul,Oct 1st\n\n[Timer]\nOnCalendar=${1:*-*-* *:00:00}\nPersistent=true",
|
|
243
|
+
"insertTextRules": 4,
|
|
244
|
+
"sortText": "02_timer_cron"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"label": "Description",
|
|
248
|
+
"kind": 14,
|
|
249
|
+
"detail": "Unit description",
|
|
250
|
+
"documentation": {
|
|
251
|
+
"value": "Human-readable description."
|
|
252
|
+
},
|
|
253
|
+
"insertText": "Description=${1:Service description}",
|
|
254
|
+
"insertTextRules": 4,
|
|
255
|
+
"sortText": "03_desc"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"label": "Documentation",
|
|
259
|
+
"kind": 14,
|
|
260
|
+
"detail": "Documentation URL",
|
|
261
|
+
"documentation": {
|
|
262
|
+
"value": "Link to documentation."
|
|
263
|
+
},
|
|
264
|
+
"insertText": "Documentation=${1:https://example.com/docs}",
|
|
265
|
+
"insertTextRules": 4,
|
|
266
|
+
"sortText": "03_doc"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"label": "After",
|
|
270
|
+
"kind": 14,
|
|
271
|
+
"detail": "Start after",
|
|
272
|
+
"documentation": {
|
|
273
|
+
"value": "Start after these units."
|
|
274
|
+
},
|
|
275
|
+
"insertText": "After=${1:network-online.target}",
|
|
276
|
+
"insertTextRules": 4,
|
|
277
|
+
"sortText": "03_after"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"label": "Before",
|
|
281
|
+
"kind": 14,
|
|
282
|
+
"detail": "Start before",
|
|
283
|
+
"documentation": {
|
|
284
|
+
"value": "Start before these units."
|
|
285
|
+
},
|
|
286
|
+
"insertText": "Before=${1:shutdown.target}",
|
|
287
|
+
"insertTextRules": 4,
|
|
288
|
+
"sortText": "03_before"
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"label": "Requires",
|
|
292
|
+
"kind": 14,
|
|
293
|
+
"detail": "Hard dependency",
|
|
294
|
+
"documentation": {
|
|
295
|
+
"value": "Hard dependency — if the required unit fails, this unit fails too."
|
|
296
|
+
},
|
|
297
|
+
"insertText": "Requires=${1:postgresql.service}",
|
|
298
|
+
"insertTextRules": 4,
|
|
299
|
+
"sortText": "03_requires"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"label": "Wants",
|
|
303
|
+
"kind": 14,
|
|
304
|
+
"detail": "Soft dependency",
|
|
305
|
+
"documentation": {
|
|
306
|
+
"value": "Soft dependency — does not fail if wanted unit fails."
|
|
307
|
+
},
|
|
308
|
+
"insertText": "Wants=${1:network-online.target}",
|
|
309
|
+
"insertTextRules": 4,
|
|
310
|
+
"sortText": "03_wants"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"label": "BindsTo",
|
|
314
|
+
"kind": 14,
|
|
315
|
+
"detail": "Bind to unit",
|
|
316
|
+
"documentation": {
|
|
317
|
+
"value": "Stronger than Requires: also stops when the bound unit stops."
|
|
318
|
+
},
|
|
319
|
+
"insertText": "BindsTo=${1:docker.service}",
|
|
320
|
+
"insertTextRules": 4,
|
|
321
|
+
"sortText": "03_bindsto"
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"label": "PartOf",
|
|
325
|
+
"kind": 14,
|
|
326
|
+
"detail": "Part of",
|
|
327
|
+
"documentation": {
|
|
328
|
+
"value": "Stop/restart with the referenced unit."
|
|
329
|
+
},
|
|
330
|
+
"insertText": "PartOf=${1:myapp.service}",
|
|
331
|
+
"insertTextRules": 4,
|
|
332
|
+
"sortText": "03_partof"
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"label": "Conflicts",
|
|
336
|
+
"kind": 14,
|
|
337
|
+
"detail": "Conflicts with",
|
|
338
|
+
"documentation": {
|
|
339
|
+
"value": "Cannot run simultaneously."
|
|
340
|
+
},
|
|
341
|
+
"insertText": "Conflicts=${1:other.service}",
|
|
342
|
+
"insertTextRules": 4,
|
|
343
|
+
"sortText": "03_conflicts"
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
"label": "Condition checks",
|
|
347
|
+
"kind": 15,
|
|
348
|
+
"detail": "Conditional start",
|
|
349
|
+
"documentation": {
|
|
350
|
+
"value": "Only start if conditions are met."
|
|
351
|
+
},
|
|
352
|
+
"insertText": "ConditionPathExists=${1:/etc/myapp/config.yml}\n# ConditionFileNotEmpty=/etc/myapp/config.yml\n# ConditionDirectoryNotEmpty=/var/spool/myapp\n# ConditionPathIsDirectory=/opt/myapp\n# ConditionVirtualization=!container\n# ConditionACPower=true\n# ConditionMemory=>=4G",
|
|
353
|
+
"insertTextRules": 4,
|
|
354
|
+
"sortText": "03_condition"
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
"label": "Type",
|
|
358
|
+
"kind": 14,
|
|
359
|
+
"detail": "Service type",
|
|
360
|
+
"documentation": {
|
|
361
|
+
"value": "Service startup type."
|
|
362
|
+
},
|
|
363
|
+
"insertText": "Type=${1|simple,exec,forking,oneshot,notify,dbus,idle|}",
|
|
364
|
+
"insertTextRules": 4,
|
|
365
|
+
"sortText": "04_type"
|
|
58
366
|
},
|
|
59
367
|
{
|
|
60
368
|
"label": "ExecStart",
|
|
61
369
|
"kind": 14,
|
|
62
|
-
"detail": "
|
|
370
|
+
"detail": "Start command",
|
|
63
371
|
"documentation": {
|
|
64
372
|
"value": "Command to start the service."
|
|
65
373
|
},
|
|
66
374
|
"insertText": "ExecStart=${1:/usr/bin/myapp}",
|
|
67
375
|
"insertTextRules": 4,
|
|
68
|
-
"sortText": "
|
|
376
|
+
"sortText": "04_execstart"
|
|
69
377
|
},
|
|
70
378
|
{
|
|
71
379
|
"label": "ExecStartPre",
|
|
72
380
|
"kind": 14,
|
|
73
381
|
"detail": "Pre-start command",
|
|
74
382
|
"documentation": {
|
|
75
|
-
"value": "
|
|
383
|
+
"value": "Commands to run before starting. Prefix with - to ignore errors."
|
|
76
384
|
},
|
|
77
|
-
"insertText": "ExecStartPre=${1
|
|
385
|
+
"insertText": "ExecStartPre=${1:-/usr/bin/myapp-check}",
|
|
78
386
|
"insertTextRules": 4,
|
|
79
|
-
"sortText": "
|
|
387
|
+
"sortText": "04_execstartpre"
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"label": "ExecStartPost",
|
|
391
|
+
"kind": 14,
|
|
392
|
+
"detail": "Post-start command",
|
|
393
|
+
"documentation": {
|
|
394
|
+
"value": "Commands to run after starting."
|
|
395
|
+
},
|
|
396
|
+
"insertText": "ExecStartPost=${1:/usr/bin/myapp-notify}",
|
|
397
|
+
"insertTextRules": 4,
|
|
398
|
+
"sortText": "04_execstartpost"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"label": "ExecStop",
|
|
402
|
+
"kind": 14,
|
|
403
|
+
"detail": "Stop command",
|
|
404
|
+
"documentation": {
|
|
405
|
+
"value": "Command to stop the service."
|
|
406
|
+
},
|
|
407
|
+
"insertText": "ExecStop=${1:/bin/kill -TERM \\$MAINPID}",
|
|
408
|
+
"insertTextRules": 4,
|
|
409
|
+
"sortText": "04_execstop"
|
|
80
410
|
},
|
|
81
411
|
{
|
|
82
412
|
"label": "ExecReload",
|
|
83
413
|
"kind": 14,
|
|
84
414
|
"detail": "Reload command",
|
|
85
415
|
"documentation": {
|
|
86
|
-
"value": "Command to reload
|
|
416
|
+
"value": "Command to reload configuration."
|
|
417
|
+
},
|
|
418
|
+
"insertText": "ExecReload=/bin/kill -HUP \\$MAINPID",
|
|
419
|
+
"insertTextRules": 4,
|
|
420
|
+
"sortText": "04_execreload"
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"label": "Restart",
|
|
424
|
+
"kind": 14,
|
|
425
|
+
"detail": "Restart policy",
|
|
426
|
+
"documentation": {
|
|
427
|
+
"value": "Restart policy on failure."
|
|
428
|
+
},
|
|
429
|
+
"insertText": "Restart=${1|on-failure,always,on-abnormal,on-watchdog,on-abort,no|}",
|
|
430
|
+
"insertTextRules": 4,
|
|
431
|
+
"sortText": "04_restart"
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"label": "RestartSec",
|
|
435
|
+
"kind": 14,
|
|
436
|
+
"detail": "Restart delay",
|
|
437
|
+
"documentation": {
|
|
438
|
+
"value": "Time to wait before restarting."
|
|
439
|
+
},
|
|
440
|
+
"insertText": "RestartSec=${1:5}",
|
|
441
|
+
"insertTextRules": 4,
|
|
442
|
+
"sortText": "04_restartsec"
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"label": "StartLimitBurst",
|
|
446
|
+
"kind": 14,
|
|
447
|
+
"detail": "Restart limit",
|
|
448
|
+
"documentation": {
|
|
449
|
+
"value": "Maximum starts within interval."
|
|
450
|
+
},
|
|
451
|
+
"insertText": "StartLimitBurst=${1:5}\nStartLimitIntervalSec=${2:60}",
|
|
452
|
+
"insertTextRules": 4,
|
|
453
|
+
"sortText": "04_startlimit"
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
"label": "TimeoutStartSec",
|
|
457
|
+
"kind": 14,
|
|
458
|
+
"detail": "Start timeout",
|
|
459
|
+
"documentation": {
|
|
460
|
+
"value": "Timeout for service to start."
|
|
87
461
|
},
|
|
88
|
-
"insertText": "
|
|
462
|
+
"insertText": "TimeoutStartSec=${1:90}",
|
|
89
463
|
"insertTextRules": 4,
|
|
90
|
-
"sortText": "
|
|
464
|
+
"sortText": "04_timeout_start"
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
"label": "TimeoutStopSec",
|
|
468
|
+
"kind": 14,
|
|
469
|
+
"detail": "Stop timeout",
|
|
470
|
+
"documentation": {
|
|
471
|
+
"value": "Timeout for service to stop before SIGKILL."
|
|
472
|
+
},
|
|
473
|
+
"insertText": "TimeoutStopSec=${1:30}",
|
|
474
|
+
"insertTextRules": 4,
|
|
475
|
+
"sortText": "04_timeout_stop"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
"label": "WatchdogSec",
|
|
479
|
+
"kind": 14,
|
|
480
|
+
"detail": "Watchdog timeout",
|
|
481
|
+
"documentation": {
|
|
482
|
+
"value": "Watchdog timeout — service must call sd_notify(WATCHDOG=1) within this interval."
|
|
483
|
+
},
|
|
484
|
+
"insertText": "WatchdogSec=${1:30}",
|
|
485
|
+
"insertTextRules": 4,
|
|
486
|
+
"sortText": "04_watchdog"
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
"label": "KillMode",
|
|
490
|
+
"kind": 14,
|
|
491
|
+
"detail": "Kill mode",
|
|
492
|
+
"documentation": {
|
|
493
|
+
"value": "How to kill the service process group."
|
|
494
|
+
},
|
|
495
|
+
"insertText": "KillMode=${1|control-group,mixed,process,none|}",
|
|
496
|
+
"insertTextRules": 4,
|
|
497
|
+
"sortText": "04_killmode"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"label": "KillSignal",
|
|
501
|
+
"kind": 14,
|
|
502
|
+
"detail": "Kill signal",
|
|
503
|
+
"documentation": {
|
|
504
|
+
"value": "Signal used to stop the service."
|
|
505
|
+
},
|
|
506
|
+
"insertText": "KillSignal=${1:SIGTERM}",
|
|
507
|
+
"insertTextRules": 4,
|
|
508
|
+
"sortText": "04_killsignal"
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
"label": "User/Group",
|
|
512
|
+
"kind": 14,
|
|
513
|
+
"detail": "User and Group",
|
|
514
|
+
"documentation": {
|
|
515
|
+
"value": "Run service as specific user."
|
|
516
|
+
},
|
|
517
|
+
"insertText": "User=${1:www-data}\nGroup=${1:www-data}",
|
|
518
|
+
"insertTextRules": 4,
|
|
519
|
+
"sortText": "04_user"
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
"label": "WorkingDirectory",
|
|
523
|
+
"kind": 14,
|
|
524
|
+
"detail": "Working directory",
|
|
525
|
+
"documentation": {
|
|
526
|
+
"value": "Set the working directory."
|
|
527
|
+
},
|
|
528
|
+
"insertText": "WorkingDirectory=${1:/opt/app}",
|
|
529
|
+
"insertTextRules": 4,
|
|
530
|
+
"sortText": "04_workdir"
|
|
91
531
|
},
|
|
92
532
|
{
|
|
93
533
|
"label": "Environment",
|
|
94
534
|
"kind": 14,
|
|
95
|
-
"detail": "Environment
|
|
535
|
+
"detail": "Environment var",
|
|
96
536
|
"documentation": {
|
|
97
|
-
"value": "Set
|
|
537
|
+
"value": "Set environment variable."
|
|
98
538
|
},
|
|
99
539
|
"insertText": "Environment=${1:KEY}=${2:value}",
|
|
100
540
|
"insertTextRules": 4,
|
|
101
|
-
"sortText": "
|
|
541
|
+
"sortText": "04_env"
|
|
102
542
|
},
|
|
103
543
|
{
|
|
104
544
|
"label": "EnvironmentFile",
|
|
105
545
|
"kind": 14,
|
|
106
546
|
"detail": "Environment file",
|
|
107
547
|
"documentation": {
|
|
108
|
-
"value": "Load environment
|
|
548
|
+
"value": "Load environment from file. Prefix with - to ignore if missing."
|
|
549
|
+
},
|
|
550
|
+
"insertText": "EnvironmentFile=${1:-/etc/default/myapp}",
|
|
551
|
+
"insertTextRules": 4,
|
|
552
|
+
"sortText": "04_envfile"
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
"label": "StandardOutput",
|
|
556
|
+
"kind": 14,
|
|
557
|
+
"detail": "Stdout target",
|
|
558
|
+
"documentation": {
|
|
559
|
+
"value": "Where to send stdout."
|
|
560
|
+
},
|
|
561
|
+
"insertText": "StandardOutput=${1|journal,console,file:/var/log/myapp.log,append:/var/log/myapp.log,null|}",
|
|
562
|
+
"insertTextRules": 4,
|
|
563
|
+
"sortText": "04_stdout"
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
"label": "StandardError",
|
|
567
|
+
"kind": 14,
|
|
568
|
+
"detail": "Stderr target",
|
|
569
|
+
"documentation": {
|
|
570
|
+
"value": "Where to send stderr."
|
|
571
|
+
},
|
|
572
|
+
"insertText": "StandardError=${1|journal,console,file:/var/log/myapp-error.log,inherit|}",
|
|
573
|
+
"insertTextRules": 4,
|
|
574
|
+
"sortText": "04_stderr"
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
"label": "SyslogIdentifier",
|
|
578
|
+
"kind": 14,
|
|
579
|
+
"detail": "Syslog identifier",
|
|
580
|
+
"documentation": {
|
|
581
|
+
"value": "Identifier for journal entries."
|
|
109
582
|
},
|
|
110
|
-
"insertText": "
|
|
583
|
+
"insertText": "SyslogIdentifier=${1:myapp}",
|
|
111
584
|
"insertTextRules": 4,
|
|
112
|
-
"sortText": "
|
|
585
|
+
"sortText": "04_syslog"
|
|
113
586
|
},
|
|
114
587
|
{
|
|
115
|
-
"label": "
|
|
588
|
+
"label": "PIDFile",
|
|
116
589
|
"kind": 14,
|
|
117
|
-
"detail": "
|
|
590
|
+
"detail": "PID file",
|
|
118
591
|
"documentation": {
|
|
119
|
-
"value": "
|
|
592
|
+
"value": "Path to PID file (for Type=forking)."
|
|
120
593
|
},
|
|
121
|
-
"insertText": "
|
|
594
|
+
"insertText": "PIDFile=${1:/var/run/myapp.pid}",
|
|
122
595
|
"insertTextRules": 4,
|
|
123
|
-
"sortText": "
|
|
596
|
+
"sortText": "04_pidfile"
|
|
124
597
|
},
|
|
125
598
|
{
|
|
126
|
-
"label": "
|
|
599
|
+
"label": "RemainAfterExit",
|
|
127
600
|
"kind": 14,
|
|
128
|
-
"detail": "
|
|
601
|
+
"detail": "Remain after exit",
|
|
129
602
|
"documentation": {
|
|
130
|
-
"value": "
|
|
603
|
+
"value": "Consider service active after main process exits (for oneshot)."
|
|
131
604
|
},
|
|
132
|
-
"insertText": "
|
|
605
|
+
"insertText": "RemainAfterExit=yes",
|
|
133
606
|
"insertTextRules": 4,
|
|
134
|
-
"sortText": "
|
|
607
|
+
"sortText": "04_remain"
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
"label": "Nice / Priority",
|
|
611
|
+
"kind": 14,
|
|
612
|
+
"detail": "Nice value",
|
|
613
|
+
"documentation": {
|
|
614
|
+
"value": "Set scheduling priority."
|
|
615
|
+
},
|
|
616
|
+
"insertText": "Nice=${1:-5}\n# CPUSchedulingPolicy=fifo\n# CPUSchedulingPriority=50\n# IOSchedulingClass=realtime\n# IOSchedulingPriority=2",
|
|
617
|
+
"insertTextRules": 4,
|
|
618
|
+
"sortText": "04_nice"
|
|
135
619
|
},
|
|
136
620
|
{
|
|
137
621
|
"label": "LimitNOFILE",
|
|
138
622
|
"kind": 14,
|
|
139
623
|
"detail": "File descriptor limit",
|
|
140
624
|
"documentation": {
|
|
141
|
-
"value": "
|
|
625
|
+
"value": "Maximum open file descriptors."
|
|
626
|
+
},
|
|
627
|
+
"insertText": "LimitNOFILE=${1:65535}",
|
|
628
|
+
"insertTextRules": 4,
|
|
629
|
+
"sortText": "05_limitnofile"
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
"label": "LimitNPROC",
|
|
633
|
+
"kind": 14,
|
|
634
|
+
"detail": "Process limit",
|
|
635
|
+
"documentation": {
|
|
636
|
+
"value": "Maximum number of processes."
|
|
637
|
+
},
|
|
638
|
+
"insertText": "LimitNPROC=${1:4096}",
|
|
639
|
+
"insertTextRules": 4,
|
|
640
|
+
"sortText": "05_limitnproc"
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
"label": "LimitCORE",
|
|
644
|
+
"kind": 14,
|
|
645
|
+
"detail": "Core dump limit",
|
|
646
|
+
"documentation": {
|
|
647
|
+
"value": "Core dump file size limit."
|
|
648
|
+
},
|
|
649
|
+
"insertText": "LimitCORE=${1:infinity}",
|
|
650
|
+
"insertTextRules": 4,
|
|
651
|
+
"sortText": "05_limitcore"
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
"label": "LimitMEMLOCK",
|
|
655
|
+
"kind": 14,
|
|
656
|
+
"detail": "Lock memory limit",
|
|
657
|
+
"documentation": {
|
|
658
|
+
"value": "Maximum locked memory."
|
|
659
|
+
},
|
|
660
|
+
"insertText": "LimitMEMLOCK=${1:infinity}",
|
|
661
|
+
"insertTextRules": 4,
|
|
662
|
+
"sortText": "05_limitmemlock"
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
"label": "MemoryMax",
|
|
666
|
+
"kind": 14,
|
|
667
|
+
"detail": "Memory max",
|
|
668
|
+
"documentation": {
|
|
669
|
+
"value": "Hard memory limit via cgroup."
|
|
670
|
+
},
|
|
671
|
+
"insertText": "MemoryMax=${1:2G}",
|
|
672
|
+
"insertTextRules": 4,
|
|
673
|
+
"sortText": "05_memmax"
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
"label": "MemoryHigh",
|
|
677
|
+
"kind": 14,
|
|
678
|
+
"detail": "Memory high watermark",
|
|
679
|
+
"documentation": {
|
|
680
|
+
"value": "Soft memory limit (throttling, not killing)."
|
|
681
|
+
},
|
|
682
|
+
"insertText": "MemoryHigh=${1:1G}",
|
|
683
|
+
"insertTextRules": 4,
|
|
684
|
+
"sortText": "05_memhigh"
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
"label": "CPUQuota",
|
|
688
|
+
"kind": 14,
|
|
689
|
+
"detail": "CPU quota",
|
|
690
|
+
"documentation": {
|
|
691
|
+
"value": "CPU time limit as percentage."
|
|
692
|
+
},
|
|
693
|
+
"insertText": "CPUQuota=${1:200%}",
|
|
694
|
+
"insertTextRules": 4,
|
|
695
|
+
"sortText": "05_cpuquota"
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
"label": "TasksMax",
|
|
699
|
+
"kind": 14,
|
|
700
|
+
"detail": "Max tasks",
|
|
701
|
+
"documentation": {
|
|
702
|
+
"value": "Maximum number of tasks (threads/processes)."
|
|
142
703
|
},
|
|
143
|
-
"insertText": "
|
|
704
|
+
"insertText": "TasksMax=${1:4096}",
|
|
144
705
|
"insertTextRules": 4,
|
|
145
|
-
"sortText": "
|
|
706
|
+
"sortText": "05_tasksmax"
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
"label": "security hardening basic",
|
|
710
|
+
"kind": 15,
|
|
711
|
+
"detail": "Basic security",
|
|
712
|
+
"documentation": {
|
|
713
|
+
"value": "Basic security hardening directives."
|
|
714
|
+
},
|
|
715
|
+
"insertText": "NoNewPrivileges=true\nProtectSystem=strict\nProtectHome=true\nPrivateTmp=true\nPrivateDevices=true\nProtectKernelTunables=true\nProtectKernelModules=true\nProtectControlGroups=true",
|
|
716
|
+
"insertTextRules": 4,
|
|
717
|
+
"sortText": "06_sec_basic"
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
"label": "security hardening full",
|
|
721
|
+
"kind": 15,
|
|
722
|
+
"detail": "Full security",
|
|
723
|
+
"documentation": {
|
|
724
|
+
"value": "Comprehensive security sandbox."
|
|
725
|
+
},
|
|
726
|
+
"insertText": "# Filesystem\nNoNewPrivileges=true\nProtectSystem=strict\nProtectHome=true\nPrivateTmp=true\nPrivateDevices=true\nReadWritePaths=${1:/opt/app/data}\n\n# Kernel\nProtectKernelTunables=true\nProtectKernelModules=true\nProtectKernelLogs=true\nProtectControlGroups=true\nProtectHostname=true\nProtectClock=true\nProtectProc=invisible\nProcSubset=pid\n\n# Network\n# RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX\n# IPAddressDeny=any\n# IPAddressAllow=localhost\n\n# Capabilities\nCapabilityBoundingSet=\nAmbientCapabilities=\n\n# Syscall filtering\nSystemCallFilter=@system-service\nSystemCallErrorNumber=EPERM\nSystemCallArchitectures=native\n\n# Misc\nLockPersonality=true\nRestrictRealtime=true\nRestrictSUIDSGID=true\nRestrictNamespaces=true\nMemoryDenyWriteExecute=true\nRemoveIPC=true",
|
|
727
|
+
"insertTextRules": 4,
|
|
728
|
+
"sortText": "06_sec_full"
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
"label": "CapabilityBoundingSet",
|
|
732
|
+
"kind": 14,
|
|
733
|
+
"detail": "Capabilities",
|
|
734
|
+
"documentation": {
|
|
735
|
+
"value": "Restrict Linux capabilities."
|
|
736
|
+
},
|
|
737
|
+
"insertText": "CapabilityBoundingSet=${1:CAP_NET_BIND_SERVICE}",
|
|
738
|
+
"insertTextRules": 4,
|
|
739
|
+
"sortText": "06_caps"
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
"label": "SystemCallFilter",
|
|
743
|
+
"kind": 14,
|
|
744
|
+
"detail": "Syscall filter",
|
|
745
|
+
"documentation": {
|
|
746
|
+
"value": "Restrict system calls."
|
|
747
|
+
},
|
|
748
|
+
"insertText": "SystemCallFilter=${1:@system-service}\nSystemCallErrorNumber=EPERM\nSystemCallArchitectures=native",
|
|
749
|
+
"insertTextRules": 4,
|
|
750
|
+
"sortText": "06_syscall"
|
|
751
|
+
},
|
|
752
|
+
{
|
|
753
|
+
"label": "ReadWritePaths",
|
|
754
|
+
"kind": 14,
|
|
755
|
+
"detail": "RW paths",
|
|
756
|
+
"documentation": {
|
|
757
|
+
"value": "Filesystem paths the service can write to (with ProtectSystem=strict)."
|
|
758
|
+
},
|
|
759
|
+
"insertText": "ReadWritePaths=${1:/opt/app/data /var/log/app}",
|
|
760
|
+
"insertTextRules": 4,
|
|
761
|
+
"sortText": "06_rwpaths"
|
|
762
|
+
},
|
|
763
|
+
{
|
|
764
|
+
"label": "WantedBy",
|
|
765
|
+
"kind": 14,
|
|
766
|
+
"detail": "Wanted by target",
|
|
767
|
+
"documentation": {
|
|
768
|
+
"value": "Target that pulls this unit."
|
|
769
|
+
},
|
|
770
|
+
"insertText": "WantedBy=${1|multi-user.target,graphical.target,timers.target,sockets.target|}",
|
|
771
|
+
"insertTextRules": 4,
|
|
772
|
+
"sortText": "07_wantedby"
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
"label": "RequiredBy",
|
|
776
|
+
"kind": 14,
|
|
777
|
+
"detail": "Required by",
|
|
778
|
+
"documentation": {
|
|
779
|
+
"value": "Hard requirement from target."
|
|
780
|
+
},
|
|
781
|
+
"insertText": "RequiredBy=${1:multi-user.target}",
|
|
782
|
+
"insertTextRules": 4,
|
|
783
|
+
"sortText": "07_requiredby"
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
"label": "Also",
|
|
787
|
+
"kind": 14,
|
|
788
|
+
"detail": "Also install",
|
|
789
|
+
"documentation": {
|
|
790
|
+
"value": "Additional units to enable/disable together."
|
|
791
|
+
},
|
|
792
|
+
"insertText": "Also=${1:myapp.socket}",
|
|
793
|
+
"insertTextRules": 4,
|
|
794
|
+
"sortText": "07_also"
|
|
146
795
|
},
|
|
147
796
|
{
|
|
148
797
|
"label": "OnCalendar",
|
|
149
798
|
"kind": 14,
|
|
150
|
-
"detail": "Calendar
|
|
799
|
+
"detail": "Calendar schedule",
|
|
800
|
+
"documentation": {
|
|
801
|
+
"value": "Calendar-based timer schedule."
|
|
802
|
+
},
|
|
803
|
+
"insertText": "OnCalendar=${1:*-*-* 00:00:00}",
|
|
804
|
+
"insertTextRules": 4,
|
|
805
|
+
"sortText": "08_oncalendar"
|
|
806
|
+
},
|
|
807
|
+
{
|
|
808
|
+
"label": "OnBootSec",
|
|
809
|
+
"kind": 14,
|
|
810
|
+
"detail": "After boot",
|
|
811
|
+
"documentation": {
|
|
812
|
+
"value": "Time after boot to trigger."
|
|
813
|
+
},
|
|
814
|
+
"insertText": "OnBootSec=${1:5min}",
|
|
815
|
+
"insertTextRules": 4,
|
|
816
|
+
"sortText": "08_onboot"
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
"label": "OnUnitActiveSec",
|
|
820
|
+
"kind": 14,
|
|
821
|
+
"detail": "After activation",
|
|
822
|
+
"documentation": {
|
|
823
|
+
"value": "Time after unit last activation to re-trigger."
|
|
824
|
+
},
|
|
825
|
+
"insertText": "OnUnitActiveSec=${1:15min}",
|
|
826
|
+
"insertTextRules": 4,
|
|
827
|
+
"sortText": "08_onunitactive"
|
|
828
|
+
},
|
|
829
|
+
{
|
|
830
|
+
"label": "Persistent",
|
|
831
|
+
"kind": 14,
|
|
832
|
+
"detail": "Persistent timer",
|
|
833
|
+
"documentation": {
|
|
834
|
+
"value": "Run missed triggers immediately on system boot."
|
|
835
|
+
},
|
|
836
|
+
"insertText": "Persistent=true",
|
|
837
|
+
"insertTextRules": 4,
|
|
838
|
+
"sortText": "08_persistent"
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
|
+
"label": "RandomizedDelaySec",
|
|
842
|
+
"kind": 14,
|
|
843
|
+
"detail": "Random delay",
|
|
844
|
+
"documentation": {
|
|
845
|
+
"value": "Add random delay to prevent thundering herd."
|
|
846
|
+
},
|
|
847
|
+
"insertText": "RandomizedDelaySec=${1:300}",
|
|
848
|
+
"insertTextRules": 4,
|
|
849
|
+
"sortText": "08_randomdelay"
|
|
850
|
+
},
|
|
851
|
+
{
|
|
852
|
+
"label": "AccuracySec",
|
|
853
|
+
"kind": 14,
|
|
854
|
+
"detail": "Timer accuracy",
|
|
855
|
+
"documentation": {
|
|
856
|
+
"value": "Timer accuracy (can coalesce with other timers)."
|
|
857
|
+
},
|
|
858
|
+
"insertText": "AccuracySec=${1:1min}",
|
|
859
|
+
"insertTextRules": 4,
|
|
860
|
+
"sortText": "08_accuracy"
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
"label": "ListenStream",
|
|
864
|
+
"kind": 14,
|
|
865
|
+
"detail": "TCP/Unix socket",
|
|
866
|
+
"documentation": {
|
|
867
|
+
"value": "TCP port or Unix socket path."
|
|
868
|
+
},
|
|
869
|
+
"insertText": "ListenStream=${1:8080}",
|
|
870
|
+
"insertTextRules": 4,
|
|
871
|
+
"sortText": "09_listenstream"
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
"label": "ListenDatagram",
|
|
875
|
+
"kind": 14,
|
|
876
|
+
"detail": "UDP socket",
|
|
877
|
+
"documentation": {
|
|
878
|
+
"value": "UDP port."
|
|
879
|
+
},
|
|
880
|
+
"insertText": "ListenDatagram=${1:514}",
|
|
881
|
+
"insertTextRules": 4,
|
|
882
|
+
"sortText": "09_listendgram"
|
|
883
|
+
},
|
|
884
|
+
{
|
|
885
|
+
"label": "Accept",
|
|
886
|
+
"kind": 14,
|
|
887
|
+
"detail": "Accept mode",
|
|
888
|
+
"documentation": {
|
|
889
|
+
"value": "Spawn instance per connection."
|
|
890
|
+
},
|
|
891
|
+
"insertText": "Accept=${1|yes,no|}",
|
|
892
|
+
"insertTextRules": 4,
|
|
893
|
+
"sortText": "09_accept"
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
"label": "specifiers",
|
|
897
|
+
"kind": 15,
|
|
898
|
+
"detail": "Unit specifiers",
|
|
151
899
|
"documentation": {
|
|
152
|
-
"value": "
|
|
900
|
+
"value": "Special variables in unit files."
|
|
153
901
|
},
|
|
154
|
-
"insertText": "
|
|
902
|
+
"insertText": "# %n Full unit name (e.g., myapp.service)\n# %N Unescaped unit name\n# %p Prefix name (part before @)\n# %i Instance name (part after @, before .suffix)\n# %I Unescaped instance name\n# %f Unescaped filename (/%I)\n# %t Runtime directory (/run or $XDG_RUNTIME_DIR)\n# %S State directory (/var/lib)\n# %C Cache directory (/var/cache)\n# %L Log directory (/var/log)\n# %h User home directory\n# %s User shell\n# %H Machine hostname\n# %% Literal %",
|
|
155
903
|
"insertTextRules": 4,
|
|
156
|
-
"sortText": "
|
|
904
|
+
"sortText": "10_specifiers"
|
|
157
905
|
},
|
|
158
906
|
{
|
|
159
|
-
"label": "
|
|
907
|
+
"label": "template instance",
|
|
160
908
|
"kind": 15,
|
|
161
|
-
"detail": "
|
|
909
|
+
"detail": "Template unit",
|
|
162
910
|
"documentation": {
|
|
163
|
-
"value": "
|
|
911
|
+
"value": "Template unit file (name@.service) for multiple instances."
|
|
164
912
|
},
|
|
165
|
-
"insertText": "
|
|
913
|
+
"insertText": "[Unit]\nDescription=${1:Service} for %i\nAfter=network-online.target\n\n[Service]\nType=simple\nUser=${2:app}\nExecStart=${3:/opt/app/bin/server} --port %i\nRestart=on-failure\n\n[Install]\nWantedBy=multi-user.target\n\n# Usage: systemctl start myapp@8080.service",
|
|
166
914
|
"insertTextRules": 4,
|
|
167
|
-
"sortText": "
|
|
915
|
+
"sortText": "10_template"
|
|
168
916
|
}
|
|
169
917
|
]
|
|
170
918
|
}
|