]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/core/path.c
update TODO
[thirdparty/systemd.git] / src / core / path.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2
3 #include <errno.h>
4 #include <sys/epoll.h>
5 #include <sys/inotify.h>
6 #include <unistd.h>
7
8 #include "bus-error.h"
9 #include "bus-util.h"
10 #include "dbus-path.h"
11 #include "dbus-unit.h"
12 #include "escape.h"
13 #include "fd-util.h"
14 #include "fs-util.h"
15 #include "glob-util.h"
16 #include "macro.h"
17 #include "mkdir.h"
18 #include "path.h"
19 #include "path-util.h"
20 #include "serialize.h"
21 #include "special.h"
22 #include "stat-util.h"
23 #include "string-table.h"
24 #include "string-util.h"
25 #include "unit-name.h"
26 #include "unit.h"
27
28 static const UnitActiveState state_translation_table[_PATH_STATE_MAX] = {
29 [PATH_DEAD] = UNIT_INACTIVE,
30 [PATH_WAITING] = UNIT_ACTIVE,
31 [PATH_RUNNING] = UNIT_ACTIVE,
32 [PATH_FAILED] = UNIT_FAILED,
33 };
34
35 static int path_dispatch_io(sd_event_source *source, int fd, uint32_t revents, void *userdata);
36
37 int path_spec_watch(PathSpec *s, sd_event_io_handler_t handler) {
38 static const int flags_table[_PATH_TYPE_MAX] = {
39 [PATH_EXISTS] = IN_DELETE_SELF|IN_MOVE_SELF|IN_ATTRIB,
40 [PATH_EXISTS_GLOB] = IN_DELETE_SELF|IN_MOVE_SELF|IN_ATTRIB,
41 [PATH_CHANGED] = IN_DELETE_SELF|IN_MOVE_SELF|IN_ATTRIB|IN_CLOSE_WRITE|IN_CREATE|IN_DELETE|IN_MOVED_FROM|IN_MOVED_TO,
42 [PATH_MODIFIED] = IN_DELETE_SELF|IN_MOVE_SELF|IN_ATTRIB|IN_CLOSE_WRITE|IN_CREATE|IN_DELETE|IN_MOVED_FROM|IN_MOVED_TO|IN_MODIFY,
43 [PATH_DIRECTORY_NOT_EMPTY] = IN_DELETE_SELF|IN_MOVE_SELF|IN_ATTRIB|IN_CREATE|IN_MOVED_TO,
44 };
45
46 bool exists = false;
47 char *slash, *oldslash = NULL;
48 int r;
49
50 assert(s);
51 assert(s->unit);
52 assert(handler);
53
54 path_spec_unwatch(s);
55
56 s->inotify_fd = inotify_init1(IN_NONBLOCK|IN_CLOEXEC);
57 if (s->inotify_fd < 0) {
58 r = -errno;
59 goto fail;
60 }
61
62 r = sd_event_add_io(s->unit->manager->event, &s->event_source, s->inotify_fd, EPOLLIN, handler, s);
63 if (r < 0)
64 goto fail;
65
66 (void) sd_event_source_set_description(s->event_source, "path");
67
68 /* This function assumes the path was passed through path_simplify()! */
69 assert(!strstr(s->path, "//"));
70
71 for (slash = strchr(s->path, '/'); ; slash = strchr(slash+1, '/')) {
72 char *cut = NULL;
73 int flags;
74 char tmp;
75
76 if (slash) {
77 cut = slash + (slash == s->path);
78 tmp = *cut;
79 *cut = '\0';
80
81 flags = IN_MOVE_SELF | IN_DELETE_SELF | IN_ATTRIB | IN_CREATE | IN_MOVED_TO;
82 } else
83 flags = flags_table[s->type];
84
85 r = inotify_add_watch(s->inotify_fd, s->path, flags);
86 if (r < 0) {
87 if (IN_SET(errno, EACCES, ENOENT)) {
88 if (cut)
89 *cut = tmp;
90 break;
91 }
92
93 /* This second call to inotify_add_watch() should fail like the previous
94 * one and is done for logging the error in a comprehensive way. */
95 r = inotify_add_watch_and_warn(s->inotify_fd, s->path, flags);
96 if (r < 0) {
97 if (cut)
98 *cut = tmp;
99 goto fail;
100 }
101
102 /* Hmm, we succeeded in adding the watch this time... let's continue. */
103 }
104 exists = true;
105
106 /* Path exists, we don't need to watch parent too closely. */
107 if (oldslash) {
108 char *cut2 = oldslash + (oldslash == s->path);
109 char tmp2 = *cut2;
110 *cut2 = '\0';
111
112 (void) inotify_add_watch(s->inotify_fd, s->path, IN_MOVE_SELF);
113 /* Error is ignored, the worst can happen is we get spurious events. */
114
115 *cut2 = tmp2;
116 }
117
118 if (cut)
119 *cut = tmp;
120
121 if (slash)
122 oldslash = slash;
123 else {
124 /* whole path has been iterated over */
125 s->primary_wd = r;
126 break;
127 }
128 }
129
130 if (!exists) {
131 r = log_error_errno(errno, "Failed to add watch on any of the components of %s: %m", s->path);
132 /* either EACCESS or ENOENT */
133 goto fail;
134 }
135
136 return 0;
137
138 fail:
139 path_spec_unwatch(s);
140 return r;
141 }
142
143 void path_spec_unwatch(PathSpec *s) {
144 assert(s);
145
146 s->event_source = sd_event_source_unref(s->event_source);
147 s->inotify_fd = safe_close(s->inotify_fd);
148 }
149
150 int path_spec_fd_event(PathSpec *s, uint32_t revents) {
151 union inotify_event_buffer buffer;
152 struct inotify_event *e;
153 ssize_t l;
154 int r = 0;
155
156 if (revents != EPOLLIN)
157 return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
158 "Got invalid poll event on inotify.");
159
160 l = read(s->inotify_fd, &buffer, sizeof(buffer));
161 if (l < 0) {
162 if (IN_SET(errno, EAGAIN, EINTR))
163 return 0;
164
165 return log_error_errno(errno, "Failed to read inotify event: %m");
166 }
167
168 FOREACH_INOTIFY_EVENT(e, buffer, l) {
169 if (IN_SET(s->type, PATH_CHANGED, PATH_MODIFIED) &&
170 s->primary_wd == e->wd)
171 r = 1;
172 }
173
174 return r;
175 }
176
177 static bool path_spec_check_good(PathSpec *s, bool initial, bool from_trigger_notify) {
178 bool b, good = false;
179
180 switch (s->type) {
181
182 case PATH_EXISTS:
183 good = access(s->path, F_OK) >= 0;
184 break;
185
186 case PATH_EXISTS_GLOB:
187 good = glob_exists(s->path) > 0;
188 break;
189
190 case PATH_DIRECTORY_NOT_EMPTY: {
191 int k;
192
193 k = dir_is_empty(s->path);
194 good = !(k == -ENOENT || k > 0);
195 break;
196 }
197
198 case PATH_CHANGED:
199 case PATH_MODIFIED:
200 b = access(s->path, F_OK) >= 0;
201 good = !initial && !from_trigger_notify && b != s->previous_exists;
202 s->previous_exists = b;
203 break;
204
205 default:
206 ;
207 }
208
209 return good;
210 }
211
212 static void path_spec_mkdir(PathSpec *s, mode_t mode) {
213 int r;
214
215 if (IN_SET(s->type, PATH_EXISTS, PATH_EXISTS_GLOB))
216 return;
217
218 r = mkdir_p_label(s->path, mode);
219 if (r < 0)
220 log_warning_errno(r, "mkdir(%s) failed: %m", s->path);
221 }
222
223 static void path_spec_dump(PathSpec *s, FILE *f, const char *prefix) {
224 const char *type;
225
226 assert_se(type = path_type_to_string(s->type));
227 fprintf(f, "%s%s: %s\n", prefix, type, s->path);
228 }
229
230 void path_spec_done(PathSpec *s) {
231 assert(s);
232 assert(s->inotify_fd == -1);
233
234 free(s->path);
235 }
236
237 static void path_init(Unit *u) {
238 Path *p = PATH(u);
239
240 assert(u);
241 assert(u->load_state == UNIT_STUB);
242
243 p->directory_mode = 0755;
244 }
245
246 void path_free_specs(Path *p) {
247 PathSpec *s;
248
249 assert(p);
250
251 while ((s = p->specs)) {
252 path_spec_unwatch(s);
253 LIST_REMOVE(spec, p->specs, s);
254 path_spec_done(s);
255 free(s);
256 }
257 }
258
259 static void path_done(Unit *u) {
260 Path *p = PATH(u);
261
262 assert(p);
263
264 path_free_specs(p);
265 }
266
267 static int path_add_mount_dependencies(Path *p) {
268 PathSpec *s;
269 int r;
270
271 assert(p);
272
273 LIST_FOREACH(spec, s, p->specs) {
274 r = unit_require_mounts_for(UNIT(p), s->path, UNIT_DEPENDENCY_FILE);
275 if (r < 0)
276 return r;
277 }
278
279 return 0;
280 }
281
282 static int path_verify(Path *p) {
283 assert(p);
284 assert(UNIT(p)->load_state == UNIT_LOADED);
285
286 if (!p->specs) {
287 log_unit_error(UNIT(p), "Path unit lacks path setting. Refusing.");
288 return -ENOEXEC;
289 }
290
291 return 0;
292 }
293
294 static int path_add_default_dependencies(Path *p) {
295 int r;
296
297 assert(p);
298
299 if (!UNIT(p)->default_dependencies)
300 return 0;
301
302 r = unit_add_dependency_by_name(UNIT(p), UNIT_BEFORE, SPECIAL_PATHS_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
303 if (r < 0)
304 return r;
305
306 if (MANAGER_IS_SYSTEM(UNIT(p)->manager)) {
307 r = unit_add_two_dependencies_by_name(UNIT(p), UNIT_AFTER, UNIT_REQUIRES, SPECIAL_SYSINIT_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
308 if (r < 0)
309 return r;
310 }
311
312 return unit_add_two_dependencies_by_name(UNIT(p), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_SHUTDOWN_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
313 }
314
315 static int path_add_trigger_dependencies(Path *p) {
316 Unit *x;
317 int r;
318
319 assert(p);
320
321 if (!hashmap_isempty(UNIT(p)->dependencies[UNIT_TRIGGERS]))
322 return 0;
323
324 r = unit_load_related_unit(UNIT(p), ".service", &x);
325 if (r < 0)
326 return r;
327
328 return unit_add_two_dependencies(UNIT(p), UNIT_BEFORE, UNIT_TRIGGERS, x, true, UNIT_DEPENDENCY_IMPLICIT);
329 }
330
331 static int path_add_extras(Path *p) {
332 int r;
333
334 r = path_add_trigger_dependencies(p);
335 if (r < 0)
336 return r;
337
338 r = path_add_mount_dependencies(p);
339 if (r < 0)
340 return r;
341
342 return path_add_default_dependencies(p);
343 }
344
345 static int path_load(Unit *u) {
346 Path *p = PATH(u);
347 int r;
348
349 assert(u);
350 assert(u->load_state == UNIT_STUB);
351
352 r = unit_load_fragment_and_dropin(u, true);
353 if (r < 0)
354 return r;
355
356 if (u->load_state != UNIT_LOADED)
357 return 0;
358
359 r = path_add_extras(p);
360 if (r < 0)
361 return r;
362
363 return path_verify(p);
364 }
365
366 static void path_dump(Unit *u, FILE *f, const char *prefix) {
367 Path *p = PATH(u);
368 Unit *trigger;
369 PathSpec *s;
370
371 assert(p);
372 assert(f);
373
374 trigger = UNIT_TRIGGER(u);
375
376 fprintf(f,
377 "%sPath State: %s\n"
378 "%sResult: %s\n"
379 "%sUnit: %s\n"
380 "%sMakeDirectory: %s\n"
381 "%sDirectoryMode: %04o\n",
382 prefix, path_state_to_string(p->state),
383 prefix, path_result_to_string(p->result),
384 prefix, trigger ? trigger->id : "n/a",
385 prefix, yes_no(p->make_directory),
386 prefix, p->directory_mode);
387
388 LIST_FOREACH(spec, s, p->specs)
389 path_spec_dump(s, f, prefix);
390 }
391
392 static void path_unwatch(Path *p) {
393 PathSpec *s;
394
395 assert(p);
396
397 LIST_FOREACH(spec, s, p->specs)
398 path_spec_unwatch(s);
399 }
400
401 static int path_watch(Path *p) {
402 int r;
403 PathSpec *s;
404
405 assert(p);
406
407 LIST_FOREACH(spec, s, p->specs) {
408 r = path_spec_watch(s, path_dispatch_io);
409 if (r < 0)
410 return r;
411 }
412
413 return 0;
414 }
415
416 static void path_set_state(Path *p, PathState state) {
417 PathState old_state;
418 assert(p);
419
420 if (p->state != state)
421 bus_unit_send_pending_change_signal(UNIT(p), false);
422
423 old_state = p->state;
424 p->state = state;
425
426 if (!IN_SET(state, PATH_WAITING, PATH_RUNNING))
427 path_unwatch(p);
428
429 if (state != old_state)
430 log_unit_debug(UNIT(p), "Changed %s -> %s", path_state_to_string(old_state), path_state_to_string(state));
431
432 unit_notify(UNIT(p), state_translation_table[old_state], state_translation_table[state], 0);
433 }
434
435 static void path_enter_waiting(Path *p, bool initial, bool from_trigger_notify);
436
437 static int path_coldplug(Unit *u) {
438 Path *p = PATH(u);
439
440 assert(p);
441 assert(p->state == PATH_DEAD);
442
443 if (p->deserialized_state != p->state) {
444
445 if (IN_SET(p->deserialized_state, PATH_WAITING, PATH_RUNNING))
446 path_enter_waiting(p, true, false);
447 else
448 path_set_state(p, p->deserialized_state);
449 }
450
451 return 0;
452 }
453
454 static void path_enter_dead(Path *p, PathResult f) {
455 assert(p);
456
457 if (p->result == PATH_SUCCESS)
458 p->result = f;
459
460 unit_log_result(UNIT(p), p->result == PATH_SUCCESS, path_result_to_string(p->result));
461 path_set_state(p, p->result != PATH_SUCCESS ? PATH_FAILED : PATH_DEAD);
462 }
463
464 static void path_enter_running(Path *p) {
465 _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
466 Unit *trigger;
467 int r;
468
469 assert(p);
470
471 /* Don't start job if we are supposed to go down */
472 if (unit_stop_pending(UNIT(p)))
473 return;
474
475 trigger = UNIT_TRIGGER(UNIT(p));
476 if (!trigger) {
477 log_unit_error(UNIT(p), "Unit to trigger vanished.");
478 path_enter_dead(p, PATH_FAILURE_RESOURCES);
479 return;
480 }
481
482 r = manager_add_job(UNIT(p)->manager, JOB_START, trigger, JOB_REPLACE, NULL, &error, NULL);
483 if (r < 0)
484 goto fail;
485
486 path_set_state(p, PATH_RUNNING);
487 path_unwatch(p);
488
489 return;
490
491 fail:
492 log_unit_warning(UNIT(p), "Failed to queue unit startup job: %s", bus_error_message(&error, r));
493 path_enter_dead(p, PATH_FAILURE_RESOURCES);
494 }
495
496 static bool path_check_good(Path *p, bool initial, bool from_trigger_notify) {
497 PathSpec *s;
498
499 assert(p);
500
501 LIST_FOREACH(spec, s, p->specs)
502 if (path_spec_check_good(s, initial, from_trigger_notify))
503 return true;
504
505 return false;
506 }
507
508 static void path_enter_waiting(Path *p, bool initial, bool from_trigger_notify) {
509 Unit *trigger;
510 int r;
511
512 /* If the triggered unit is already running, so are we */
513 trigger = UNIT_TRIGGER(UNIT(p));
514 if (trigger && !UNIT_IS_INACTIVE_OR_FAILED(unit_active_state(trigger))) {
515 path_set_state(p, PATH_RUNNING);
516 path_unwatch(p);
517 return;
518 }
519
520 if (path_check_good(p, initial, from_trigger_notify)) {
521 log_unit_debug(UNIT(p), "Got triggered.");
522 path_enter_running(p);
523 return;
524 }
525
526 r = path_watch(p);
527 if (r < 0)
528 goto fail;
529
530 /* Hmm, so now we have created inotify watches, but the file
531 * might have appeared/been removed by now, so we must
532 * recheck */
533
534 if (path_check_good(p, false, from_trigger_notify)) {
535 log_unit_debug(UNIT(p), "Got triggered.");
536 path_enter_running(p);
537 return;
538 }
539
540 path_set_state(p, PATH_WAITING);
541 return;
542
543 fail:
544 log_unit_warning_errno(UNIT(p), r, "Failed to enter waiting state: %m");
545 path_enter_dead(p, PATH_FAILURE_RESOURCES);
546 }
547
548 static void path_mkdir(Path *p) {
549 PathSpec *s;
550
551 assert(p);
552
553 if (!p->make_directory)
554 return;
555
556 LIST_FOREACH(spec, s, p->specs)
557 path_spec_mkdir(s, p->directory_mode);
558 }
559
560 static int path_start(Unit *u) {
561 Path *p = PATH(u);
562 int r;
563
564 assert(p);
565 assert(IN_SET(p->state, PATH_DEAD, PATH_FAILED));
566
567 r = unit_test_trigger_loaded(u);
568 if (r < 0)
569 return r;
570
571 r = unit_test_start_limit(u);
572 if (r < 0) {
573 path_enter_dead(p, PATH_FAILURE_START_LIMIT_HIT);
574 return r;
575 }
576
577 r = unit_acquire_invocation_id(u);
578 if (r < 0)
579 return r;
580
581 path_mkdir(p);
582
583 p->result = PATH_SUCCESS;
584 path_enter_waiting(p, true, false);
585
586 return 1;
587 }
588
589 static int path_stop(Unit *u) {
590 Path *p = PATH(u);
591
592 assert(p);
593 assert(IN_SET(p->state, PATH_WAITING, PATH_RUNNING));
594
595 path_enter_dead(p, PATH_SUCCESS);
596 return 1;
597 }
598
599 static int path_serialize(Unit *u, FILE *f, FDSet *fds) {
600 Path *p = PATH(u);
601 PathSpec *s;
602
603 assert(u);
604 assert(f);
605 assert(fds);
606
607 (void) serialize_item(f, "state", path_state_to_string(p->state));
608 (void) serialize_item(f, "result", path_result_to_string(p->result));
609
610 LIST_FOREACH(spec, s, p->specs) {
611 const char *type;
612 _cleanup_free_ char *escaped = NULL;
613
614 escaped = cescape(s->path);
615 if (!escaped)
616 return log_oom();
617
618 assert_se(type = path_type_to_string(s->type));
619 (void) serialize_item_format(f, "path-spec", "%s %i %s",
620 type,
621 s->previous_exists,
622 escaped);
623 }
624
625 return 0;
626 }
627
628 static int path_deserialize_item(Unit *u, const char *key, const char *value, FDSet *fds) {
629 Path *p = PATH(u);
630
631 assert(u);
632 assert(key);
633 assert(value);
634 assert(fds);
635
636 if (streq(key, "state")) {
637 PathState state;
638
639 state = path_state_from_string(value);
640 if (state < 0)
641 log_unit_debug(u, "Failed to parse state value: %s", value);
642 else
643 p->deserialized_state = state;
644
645 } else if (streq(key, "result")) {
646 PathResult f;
647
648 f = path_result_from_string(value);
649 if (f < 0)
650 log_unit_debug(u, "Failed to parse result value: %s", value);
651 else if (f != PATH_SUCCESS)
652 p->result = f;
653
654 } else if (streq(key, "path-spec")) {
655 int previous_exists, skip = 0, r;
656 _cleanup_free_ char *type_str = NULL;
657
658 if (sscanf(value, "%ms %i %n", &type_str, &previous_exists, &skip) < 2)
659 log_unit_debug(u, "Failed to parse path-spec value: %s", value);
660 else {
661 _cleanup_free_ char *unescaped = NULL;
662 PathType type;
663 PathSpec *s;
664
665 type = path_type_from_string(type_str);
666 if (type < 0) {
667 log_unit_warning(u, "Unknown path type \"%s\", ignoring.", type_str);
668 return 0;
669 }
670
671 r = cunescape(value+skip, 0, &unescaped);
672 if (r < 0) {
673 log_unit_warning_errno(u, r, "Failed to unescape serialize path: %m");
674 return 0;
675 }
676
677 LIST_FOREACH(spec, s, p->specs)
678 if (s->type == type &&
679 path_equal(s->path, unescaped)) {
680
681 s->previous_exists = previous_exists;
682 break;
683 }
684 }
685
686 } else
687 log_unit_debug(u, "Unknown serialization key: %s", key);
688
689 return 0;
690 }
691
692 _pure_ static UnitActiveState path_active_state(Unit *u) {
693 assert(u);
694
695 return state_translation_table[PATH(u)->state];
696 }
697
698 _pure_ static const char *path_sub_state_to_string(Unit *u) {
699 assert(u);
700
701 return path_state_to_string(PATH(u)->state);
702 }
703
704 static int path_dispatch_io(sd_event_source *source, int fd, uint32_t revents, void *userdata) {
705 PathSpec *s = userdata;
706 Path *p;
707 int changed;
708
709 assert(s);
710 assert(s->unit);
711 assert(fd >= 0);
712
713 p = PATH(s->unit);
714
715 if (!IN_SET(p->state, PATH_WAITING, PATH_RUNNING))
716 return 0;
717
718 /* log_debug("inotify wakeup on %s.", UNIT(p)->id); */
719
720 LIST_FOREACH(spec, s, p->specs)
721 if (path_spec_owns_inotify_fd(s, fd))
722 break;
723
724 if (!s) {
725 log_error("Got event on unknown fd.");
726 goto fail;
727 }
728
729 changed = path_spec_fd_event(s, revents);
730 if (changed < 0)
731 goto fail;
732
733 if (changed)
734 path_enter_running(p);
735 else
736 path_enter_waiting(p, false, false);
737
738 return 0;
739
740 fail:
741 path_enter_dead(p, PATH_FAILURE_RESOURCES);
742 return 0;
743 }
744
745 static void path_trigger_notify(Unit *u, Unit *other) {
746 Path *p = PATH(u);
747
748 assert(u);
749 assert(other);
750
751 /* Invoked whenever the unit we trigger changes state or gains
752 * or loses a job */
753
754 if (other->load_state != UNIT_LOADED)
755 return;
756
757 if (p->state == PATH_RUNNING &&
758 UNIT_IS_INACTIVE_OR_FAILED(unit_active_state(other))) {
759 log_unit_debug(UNIT(p), "Got notified about unit deactivation.");
760 path_enter_waiting(p, false, true);
761 } else if (p->state == PATH_WAITING &&
762 !UNIT_IS_INACTIVE_OR_FAILED(unit_active_state(other))) {
763 log_unit_debug(UNIT(p), "Got notified about unit activation.");
764 path_enter_waiting(p, false, true);
765 }
766 }
767
768 static void path_reset_failed(Unit *u) {
769 Path *p = PATH(u);
770
771 assert(p);
772
773 if (p->state == PATH_FAILED)
774 path_set_state(p, PATH_DEAD);
775
776 p->result = PATH_SUCCESS;
777 }
778
779 static const char* const path_type_table[_PATH_TYPE_MAX] = {
780 [PATH_EXISTS] = "PathExists",
781 [PATH_EXISTS_GLOB] = "PathExistsGlob",
782 [PATH_DIRECTORY_NOT_EMPTY] = "DirectoryNotEmpty",
783 [PATH_CHANGED] = "PathChanged",
784 [PATH_MODIFIED] = "PathModified",
785 };
786
787 DEFINE_STRING_TABLE_LOOKUP(path_type, PathType);
788
789 static const char* const path_result_table[_PATH_RESULT_MAX] = {
790 [PATH_SUCCESS] = "success",
791 [PATH_FAILURE_RESOURCES] = "resources",
792 [PATH_FAILURE_START_LIMIT_HIT] = "start-limit-hit",
793 };
794
795 DEFINE_STRING_TABLE_LOOKUP(path_result, PathResult);
796
797 const UnitVTable path_vtable = {
798 .object_size = sizeof(Path),
799
800 .sections =
801 "Unit\0"
802 "Path\0"
803 "Install\0",
804 .private_section = "Path",
805
806 .can_transient = true,
807 .can_fail = true,
808 .can_trigger = true,
809
810 .init = path_init,
811 .done = path_done,
812 .load = path_load,
813
814 .coldplug = path_coldplug,
815
816 .dump = path_dump,
817
818 .start = path_start,
819 .stop = path_stop,
820
821 .serialize = path_serialize,
822 .deserialize_item = path_deserialize_item,
823
824 .active_state = path_active_state,
825 .sub_state_to_string = path_sub_state_to_string,
826
827 .trigger_notify = path_trigger_notify,
828
829 .reset_failed = path_reset_failed,
830
831 .bus_set_property = bus_path_set_property,
832 };