chiark / gitweb /
man: add missing parts to man pages
[elogind.git] / src / automount.c
1 /*-*- Mode: C; c-basic-offset: 8 -*-*/
2
3 /***
4   This file is part of systemd.
5
6   Copyright 2010 Lennart Poettering
7
8   systemd is free software; you can redistribute it and/or modify it
9   under the terms of the GNU General Public License as published by
10   the Free Software Foundation; either version 2 of the License, or
11   (at your option) any later version.
12
13   systemd is distributed in the hope that it will be useful, but
14   WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16   General Public License for more details.
17
18   You should have received a copy of the GNU General Public License
19   along with systemd; If not, see <http://www.gnu.org/licenses/>.
20 ***/
21
22 #include <errno.h>
23 #include <limits.h>
24 #include <sys/mount.h>
25 #include <unistd.h>
26 #include <fcntl.h>
27 #include <sys/epoll.h>
28 #include <sys/stat.h>
29 #include <linux/auto_fs4.h>
30 #include <linux/auto_dev-ioctl.h>
31
32 #include "unit.h"
33 #include "automount.h"
34 #include "load-fragment.h"
35 #include "load-dropin.h"
36 #include "unit-name.h"
37 #include "dbus-automount.h"
38
39 static const UnitActiveState state_translation_table[_AUTOMOUNT_STATE_MAX] = {
40         [AUTOMOUNT_DEAD] = UNIT_INACTIVE,
41         [AUTOMOUNT_WAITING] = UNIT_ACTIVE,
42         [AUTOMOUNT_RUNNING] = UNIT_ACTIVE,
43         [AUTOMOUNT_MAINTENANCE] = UNIT_MAINTENANCE
44 };
45
46 static int open_dev_autofs(Manager *m);
47
48 static void automount_init(Unit *u) {
49         Automount *a = AUTOMOUNT(u);
50
51         assert(u);
52         assert(u->meta.load_state == UNIT_STUB);
53
54         a->pipe_watch.fd = a->pipe_fd = -1;
55         a->pipe_watch.type = WATCH_INVALID;
56
57         a->directory_mode = 0755;
58 }
59
60 static void repeat_unmout(const char *path) {
61         assert(path);
62
63         for (;;) {
64                 /* If there are multiple mounts on a mount point, this
65                  * removes them all */
66
67                 if (umount2(path, MNT_DETACH) >= 0)
68                         continue;
69
70                 if (errno != EINVAL)
71                         log_error("Failed to unmount: %m");
72
73                 break;
74         }
75 }
76
77 static void unmount_autofs(Automount *a) {
78         assert(a);
79
80         if (a->pipe_fd < 0)
81                 return;
82
83         automount_send_ready(a, -EHOSTDOWN);
84
85         unit_unwatch_fd(UNIT(a), &a->pipe_watch);
86         close_nointr_nofail(a->pipe_fd);
87         a->pipe_fd = -1;
88
89         /* If we reload/reexecute things we keep the mount point
90          * around */
91         if (a->where &&
92             (a->meta.manager->exit_code != MANAGER_RELOAD &&
93              a->meta.manager->exit_code != MANAGER_REEXECUTE))
94                 repeat_unmout(a->where);
95 }
96
97 static void automount_done(Unit *u) {
98         Automount *a = AUTOMOUNT(u);
99
100         assert(a);
101
102         unmount_autofs(a);
103         a->mount = NULL;
104
105         free(a->where);
106         a->where = NULL;
107
108         set_free(a->tokens);
109         a->tokens = NULL;
110 }
111
112 int automount_add_one_mount_link(Automount *a, Mount *m) {
113         int r;
114
115         assert(a);
116         assert(m);
117
118         if (a->meta.load_state != UNIT_LOADED ||
119             m->meta.load_state != UNIT_LOADED)
120                 return 0;
121
122         if (!path_startswith(a->where, m->where))
123                 return 0;
124
125         if (path_equal(a->where, m->where))
126                 return 0;
127
128         if ((r = unit_add_two_dependencies(UNIT(a), UNIT_AFTER, UNIT_REQUIRES, UNIT(m), true)) < 0)
129                 return r;
130
131         return 0;
132 }
133
134 static int automount_add_mount_links(Automount *a) {
135         Meta *other;
136         int r;
137
138         assert(a);
139
140         LIST_FOREACH(units_per_type, other, a->meta.manager->units_per_type[UNIT_MOUNT])
141                 if ((r = automount_add_one_mount_link(a, (Mount*) other)) < 0)
142                         return r;
143
144         return 0;
145 }
146
147 static int automount_verify(Automount *a) {
148         bool b;
149         char *e;
150         assert(a);
151
152         if (a->meta.load_state != UNIT_LOADED)
153                 return 0;
154
155         if (!(e = unit_name_from_path(a->where, ".automount")))
156                 return -ENOMEM;
157
158         b = unit_has_name(UNIT(a), e);
159         free(e);
160
161         if (!b) {
162                 log_error("%s's Where setting doesn't match unit name. Refusing.", a->meta.id);
163                 return -EINVAL;
164         }
165
166         return 0;
167 }
168
169 static int automount_load(Unit *u) {
170         int r;
171         Automount *a = AUTOMOUNT(u);
172
173         assert(u);
174         assert(u->meta.load_state == UNIT_STUB);
175
176         /* Load a .automount file */
177         if ((r = unit_load_fragment_and_dropin_optional(u)) < 0)
178                 return r;
179
180         if (u->meta.load_state == UNIT_LOADED) {
181
182                 if (!a->where)
183                         if (!(a->where = unit_name_to_path(u->meta.id)))
184                                 return -ENOMEM;
185
186                 path_kill_slashes(a->where);
187
188                 if ((r = automount_add_mount_links(a)) < 0)
189                         return r;
190
191                 if ((r = unit_load_related_unit(u, ".mount", (Unit**) &a->mount)) < 0)
192                         return r;
193
194                 if ((r = unit_add_dependency(u, UNIT_BEFORE, UNIT(a->mount), true)) < 0)
195                         return r;
196         }
197
198         return automount_verify(a);
199 }
200
201 static void automount_set_state(Automount *a, AutomountState state) {
202         AutomountState old_state;
203         assert(a);
204
205         old_state = a->state;
206         a->state = state;
207
208         if (state != AUTOMOUNT_WAITING &&
209             state != AUTOMOUNT_RUNNING)
210                 unmount_autofs(a);
211
212         if (state != old_state)
213                 log_debug("%s changed %s -> %s",
214                           a->meta.id,
215                           automount_state_to_string(old_state),
216                           automount_state_to_string(state));
217
218         unit_notify(UNIT(a), state_translation_table[old_state], state_translation_table[state]);
219 }
220
221 static int automount_coldplug(Unit *u) {
222         Automount *a = AUTOMOUNT(u);
223         int r;
224
225         assert(a);
226         assert(a->state == AUTOMOUNT_DEAD);
227
228         if (a->deserialized_state != a->state) {
229
230                 if ((r = open_dev_autofs(u->meta.manager)) < 0)
231                         return r;
232
233                 if (a->deserialized_state == AUTOMOUNT_WAITING ||
234                     a->deserialized_state == AUTOMOUNT_RUNNING) {
235
236                         assert(a->pipe_fd >= 0);
237
238                         if ((r = unit_watch_fd(UNIT(a), a->pipe_fd, EPOLLIN, &a->pipe_watch)) < 0)
239                                 return r;
240                 }
241
242                 automount_set_state(a, a->deserialized_state);
243         }
244
245         return 0;
246 }
247
248 static void automount_dump(Unit *u, FILE *f, const char *prefix) {
249         Automount *a = AUTOMOUNT(u);
250
251         assert(a);
252
253         fprintf(f,
254                 "%sAutomount State: %s\n"
255                 "%sWhere: %s\n"
256                 "%sDirectoryMode: %04o\n",
257                 prefix, automount_state_to_string(a->state),
258                 prefix, a->where,
259                 prefix, a->directory_mode);
260 }
261
262 static void automount_enter_dead(Automount *a, bool success) {
263         assert(a);
264
265         if (!success)
266                 a->failure = true;
267
268         automount_set_state(a, a->failure ? AUTOMOUNT_MAINTENANCE : AUTOMOUNT_DEAD);
269 }
270
271 static int open_dev_autofs(Manager *m) {
272         struct autofs_dev_ioctl param;
273
274         assert(m);
275
276         if (m->dev_autofs_fd >= 0)
277                 return m->dev_autofs_fd;
278
279         if ((m->dev_autofs_fd = open("/dev/autofs", O_CLOEXEC|O_RDONLY)) < 0) {
280                 log_error("Failed to open /dev/autofs: %s", strerror(errno));
281                 return -errno;
282         }
283
284         init_autofs_dev_ioctl(&param);
285         if (ioctl(m->dev_autofs_fd, AUTOFS_DEV_IOCTL_VERSION, &param) < 0) {
286                 close_nointr_nofail(m->dev_autofs_fd);
287                 m->dev_autofs_fd = -1;
288                 return -errno;
289         }
290
291         log_debug("Autofs kernel version %i.%i", param.ver_major, param.ver_minor);
292
293         return m->dev_autofs_fd;
294 }
295
296 static int open_ioctl_fd(int dev_autofs_fd, const char *where, dev_t devid) {
297         struct autofs_dev_ioctl *param;
298         size_t l;
299         int r;
300
301         assert(dev_autofs_fd >= 0);
302         assert(where);
303
304         l = sizeof(struct autofs_dev_ioctl) + strlen(where) + 1;
305
306         if (!(param = malloc(l)))
307                 return -ENOMEM;
308
309         init_autofs_dev_ioctl(param);
310         param->size = l;
311         param->ioctlfd = -1;
312         param->openmount.devid = devid;
313         strcpy(param->path, where);
314
315         if (ioctl(dev_autofs_fd, AUTOFS_DEV_IOCTL_OPENMOUNT, param) < 0) {
316                 r = -errno;
317                 goto finish;
318         }
319
320         if (param->ioctlfd < 0) {
321                 r = -EIO;
322                 goto finish;
323         }
324
325         fd_cloexec(param->ioctlfd, true);
326         r = param->ioctlfd;
327
328 finish:
329         free(param);
330         return r;
331 }
332
333 static int autofs_protocol(int dev_autofs_fd, int ioctl_fd) {
334         uint32_t major, minor;
335         struct autofs_dev_ioctl param;
336
337         assert(dev_autofs_fd >= 0);
338         assert(ioctl_fd >= 0);
339
340         init_autofs_dev_ioctl(&param);
341         param.ioctlfd = ioctl_fd;
342
343         if (ioctl(dev_autofs_fd, AUTOFS_DEV_IOCTL_PROTOVER, &param) < 0)
344                 return -errno;
345
346         major = param.protover.version;
347
348         init_autofs_dev_ioctl(&param);
349         param.ioctlfd = ioctl_fd;
350
351         if (ioctl(dev_autofs_fd, AUTOFS_DEV_IOCTL_PROTOSUBVER, &param) < 0)
352                 return -errno;
353
354         minor = param.protosubver.sub_version;
355
356         log_debug("Autofs protocol version %i.%i", major, minor);
357         return 0;
358 }
359
360 static int autofs_set_timeout(int dev_autofs_fd, int ioctl_fd, time_t sec) {
361         struct autofs_dev_ioctl param;
362
363         assert(dev_autofs_fd >= 0);
364         assert(ioctl_fd >= 0);
365
366         init_autofs_dev_ioctl(&param);
367         param.ioctlfd = ioctl_fd;
368         param.timeout.timeout = sec;
369
370         if (ioctl(dev_autofs_fd, AUTOFS_DEV_IOCTL_TIMEOUT, &param) < 0)
371                 return -errno;
372
373         return 0;
374 }
375
376 static int autofs_send_ready(int dev_autofs_fd, int ioctl_fd, uint32_t token, int status) {
377         struct autofs_dev_ioctl param;
378
379         assert(dev_autofs_fd >= 0);
380         assert(ioctl_fd >= 0);
381
382         init_autofs_dev_ioctl(&param);
383         param.ioctlfd = ioctl_fd;
384
385         if (status) {
386                 param.fail.token = token;
387                 param.fail.status = status;
388         } else
389                 param.ready.token = token;
390
391         if (ioctl(dev_autofs_fd, status ? AUTOFS_DEV_IOCTL_FAIL : AUTOFS_DEV_IOCTL_READY, &param) < 0)
392                 return -errno;
393
394         return 0;
395 }
396
397 int automount_send_ready(Automount *a, int status) {
398         int ioctl_fd, r;
399         unsigned token;
400
401         assert(a);
402         assert(status <= 0);
403
404         if (set_isempty(a->tokens))
405                 return 0;
406
407         if ((ioctl_fd = open_ioctl_fd(a->meta.manager->dev_autofs_fd, a->where, a->dev_id)) < 0) {
408                 r = ioctl_fd;
409                 goto fail;
410         }
411
412         if (status)
413                 log_debug("Sending failure: %s", strerror(-status));
414         else
415                 log_debug("Sending success.");
416
417         /* Autofs thankfully does not hand out 0 as a token */
418         while ((token = PTR_TO_UINT(set_steal_first(a->tokens)))) {
419                 int k;
420
421                 /* Autofs fun fact II:
422                  *
423                  * if you pass a positive status code here, the kernel will
424                  * freeze! Yay! */
425
426                 if ((k = autofs_send_ready(a->meta.manager->dev_autofs_fd,
427                                            ioctl_fd,
428                                            token,
429                                            status)) < 0)
430                         r = k;
431         }
432
433         r = 0;
434
435 fail:
436         if (ioctl_fd >= 0)
437                 close_nointr_nofail(ioctl_fd);
438
439         return r;
440 }
441
442 static void automount_enter_waiting(Automount *a) {
443         int p[2] = { -1, -1 };
444         char name[32], options[128];
445         bool mounted = false;
446         int r, ioctl_fd = -1, dev_autofs_fd;
447         struct stat st;
448
449         assert(a);
450         assert(a->pipe_fd < 0);
451         assert(a->where);
452
453         if (a->tokens)
454                 set_clear(a->tokens);
455
456         if ((dev_autofs_fd = open_dev_autofs(a->meta.manager)) < 0) {
457                 r = dev_autofs_fd;
458                 goto fail;
459         }
460
461         /* We knowingly ignore the results of this call */
462         mkdir_p(a->where, 0555);
463
464         if (pipe2(p, O_NONBLOCK|O_CLOEXEC) < 0) {
465                 r = -errno;
466                 goto fail;
467         }
468
469         snprintf(options, sizeof(options), "fd=%i,pgrp=%u,minproto=5,maxproto=5,direct", p[1], (unsigned) getpgrp());
470         char_array_0(options);
471
472         snprintf(name, sizeof(name), "systemd-%u", (unsigned) getpid());
473         char_array_0(name);
474
475         if (mount(name, a->where, "autofs", 0, options) < 0) {
476                 r = -errno;
477                 goto fail;
478         }
479
480         mounted = true;
481
482         close_nointr_nofail(p[1]);
483         p[1] = -1;
484
485         if (stat(a->where, &st) < 0) {
486                 r = -errno;
487                 goto fail;
488         }
489
490         if ((ioctl_fd = open_ioctl_fd(dev_autofs_fd, a->where, st.st_dev)) < 0) {
491                 r = ioctl_fd;
492                 goto fail;
493         }
494
495         if ((r = autofs_protocol(dev_autofs_fd, ioctl_fd)) < 0)
496                 goto fail;
497
498         if ((r = autofs_set_timeout(dev_autofs_fd, ioctl_fd, 300)) < 0)
499                 goto fail;
500
501         /* Autofs fun fact:
502          *
503          * Unless we close the ioctl fd here, for some weird reason
504          * the direct mount will not receive events from the
505          * kernel. */
506
507         close_nointr_nofail(ioctl_fd);
508         ioctl_fd = -1;
509
510         if ((r = unit_watch_fd(UNIT(a), p[0], EPOLLIN, &a->pipe_watch)) < 0)
511                 goto fail;
512
513         a->pipe_fd = p[0];
514         a->dev_id = st.st_dev;
515
516         automount_set_state(a, AUTOMOUNT_WAITING);
517
518         return;
519
520 fail:
521         assert_se(close_pipe(p) == 0);
522
523         if (ioctl_fd >= 0)
524                 close_nointr_nofail(ioctl_fd);
525
526         if (mounted)
527                 repeat_unmout(a->where);
528
529         log_error("Failed to initialize automounter: %s", strerror(-r));
530         automount_enter_dead(a, false);
531 }
532
533 static void automount_enter_runnning(Automount *a) {
534         int r;
535         struct stat st;
536
537         assert(a);
538         assert(a->mount);
539
540         mkdir_p(a->where, a->directory_mode);
541
542         /* Before we do anything, let's see if somebody is playing games with us? */
543         if (lstat(a->where, &st) < 0) {
544                 log_warning("%s failed stat automount point: %m", a->meta.id);
545                 goto fail;
546         }
547
548         if (!S_ISDIR(st.st_mode) || st.st_dev != a->dev_id)
549                 log_info("%s's automount point already active?", a->meta.id);
550         else if ((r = manager_add_job(a->meta.manager, JOB_START, UNIT(a->mount), JOB_REPLACE, true, NULL)) < 0) {
551                 log_warning("%s failed to queue mount startup job: %s", a->meta.id, strerror(-r));
552                 goto fail;
553         }
554
555         automount_set_state(a, AUTOMOUNT_RUNNING);
556         return;
557
558 fail:
559         automount_enter_dead(a, false);
560 }
561
562 static int automount_start(Unit *u) {
563         Automount *a = AUTOMOUNT(u);
564
565         assert(a);
566
567         assert(a->state == AUTOMOUNT_DEAD || a->state == AUTOMOUNT_MAINTENANCE);
568
569         if (path_is_mount_point(a->where)) {
570                 log_error("Path %s is already a mount point, refusing start for %s", a->where, u->meta.id);
571                 return -EEXIST;
572         }
573
574         if (a->mount->meta.load_state != UNIT_LOADED)
575                 return -ENOENT;
576
577         a->failure = false;
578         automount_enter_waiting(a);
579         return 0;
580 }
581
582 static int automount_stop(Unit *u) {
583         Automount *a = AUTOMOUNT(u);
584
585         assert(a);
586
587         assert(a->state == AUTOMOUNT_WAITING || a->state == AUTOMOUNT_RUNNING);
588
589         automount_enter_dead(a, true);
590         return 0;
591 }
592
593 static int automount_serialize(Unit *u, FILE *f, FDSet *fds) {
594         Automount *a = AUTOMOUNT(u);
595         void *p;
596         Iterator i;
597
598         assert(a);
599         assert(f);
600         assert(fds);
601
602         unit_serialize_item(u, f, "state", automount_state_to_string(a->state));
603         unit_serialize_item(u, f, "failure", yes_no(a->failure));
604         unit_serialize_item_format(u, f, "dev-id", "%u", (unsigned) a->dev_id);
605
606         SET_FOREACH(p, a->tokens, i)
607                 unit_serialize_item_format(u, f, "token", "%u", PTR_TO_UINT(p));
608
609         if (a->pipe_fd >= 0) {
610                 int copy;
611
612                 if ((copy = fdset_put_dup(fds, a->pipe_fd)) < 0)
613                         return copy;
614
615                 unit_serialize_item_format(u, f, "pipe-fd", "%i", copy);
616         }
617
618         return 0;
619 }
620
621 static int automount_deserialize_item(Unit *u, const char *key, const char *value, FDSet *fds) {
622         Automount *a = AUTOMOUNT(u);
623         int r;
624
625         assert(a);
626         assert(fds);
627
628         if (streq(key, "state")) {
629                 AutomountState state;
630
631                 if ((state = automount_state_from_string(value)) < 0)
632                         log_debug("Failed to parse state value %s", value);
633                 else
634                         a->deserialized_state = state;
635         } else if (streq(key, "failure")) {
636                 int b;
637
638                 if ((b = parse_boolean(value)) < 0)
639                         log_debug("Failed to parse failure value %s", value);
640                 else
641                         a->failure = b || a->failure;
642         } else if (streq(key, "dev-id")) {
643                 unsigned d;
644
645                 if (safe_atou(value, &d) < 0)
646                         log_debug("Failed to parse dev-id value %s", value);
647                 else
648                         a->dev_id = (unsigned) d;
649         } else if (streq(key, "token")) {
650                 unsigned token;
651
652                 if (safe_atou(value, &token) < 0)
653                         log_debug("Failed to parse token value %s", value);
654                 else {
655                         if (!a->tokens)
656                                 if (!(a->tokens = set_new(trivial_hash_func, trivial_compare_func)))
657                                         return -ENOMEM;
658
659                         if ((r = set_put(a->tokens, UINT_TO_PTR(token))) < 0)
660                                 return r;
661                 }
662         } else if (streq(key, "pipe-fd")) {
663                 int fd;
664
665                 if (safe_atoi(value, &fd) < 0 || fd < 0 || !fdset_contains(fds, fd))
666                         log_debug("Failed to parse pipe-fd value %s", value);
667                 else {
668                         if (a->pipe_fd >= 0)
669                                 close_nointr_nofail(a->pipe_fd);
670
671                         a->pipe_fd = fdset_remove(fds, fd);
672                 }
673         } else
674                 log_debug("Unknown serialization key '%s'", key);
675
676         return 0;
677 }
678
679 static UnitActiveState automount_active_state(Unit *u) {
680         assert(u);
681
682         return state_translation_table[AUTOMOUNT(u)->state];
683 }
684
685 static const char *automount_sub_state_to_string(Unit *u) {
686         assert(u);
687
688         return automount_state_to_string(AUTOMOUNT(u)->state);
689 }
690
691 static bool automount_check_gc(Unit *u) {
692         Automount *a = AUTOMOUNT(u);
693
694         assert(a);
695
696         return UNIT_VTABLE(UNIT(a->mount))->check_gc(UNIT(a->mount));
697 }
698
699 static void automount_fd_event(Unit *u, int fd, uint32_t events, Watch *w) {
700         Automount *a = AUTOMOUNT(u);
701         union autofs_v5_packet_union packet;
702         ssize_t l;
703         int r;
704
705         assert(a);
706         assert(fd == a->pipe_fd);
707
708         if (events != EPOLLIN) {
709                 log_error("Got invalid poll event on pipe.");
710                 goto fail;
711         }
712
713         if ((l = loop_read(a->pipe_fd, &packet, sizeof(packet), true)) != sizeof(packet)) {
714                 log_error("Invalid read from pipe: %s", l < 0 ? strerror(-l) : "short read");
715                 goto fail;
716         }
717
718         switch (packet.hdr.type) {
719
720         case autofs_ptype_missing_direct:
721                 log_debug("Got direct mount request for %s", packet.v5_packet.name);
722
723                 if (!a->tokens)
724                         if (!(a->tokens = set_new(trivial_hash_func, trivial_compare_func))) {
725                                 log_error("Failed to allocate token set.");
726                                 goto fail;
727                         }
728
729                 if ((r = set_put(a->tokens, UINT_TO_PTR(packet.v5_packet.wait_queue_token))) < 0) {
730                         log_error("Failed to remember token: %s", strerror(-r));
731                         goto fail;
732                 }
733
734                 automount_enter_runnning(a);
735                 break;
736
737         default:
738                 log_error("Received unknown automount request %i", packet.hdr.type);
739                 break;
740         }
741
742         return;
743
744 fail:
745         automount_enter_dead(a, false);
746 }
747
748 static void automount_shutdown(Manager *m) {
749         assert(m);
750
751         if (m->dev_autofs_fd >= 0)
752                 close_nointr_nofail(m->dev_autofs_fd);
753 }
754
755 static const char* const automount_state_table[_AUTOMOUNT_STATE_MAX] = {
756         [AUTOMOUNT_DEAD] = "dead",
757         [AUTOMOUNT_WAITING] = "waiting",
758         [AUTOMOUNT_RUNNING] = "running",
759         [AUTOMOUNT_MAINTENANCE] = "maintenance"
760 };
761
762 DEFINE_STRING_TABLE_LOOKUP(automount_state, AutomountState);
763
764 const UnitVTable automount_vtable = {
765         .suffix = ".automount",
766
767         .no_alias = true,
768         .no_instances = true,
769
770         .init = automount_init,
771         .load = automount_load,
772         .done = automount_done,
773
774         .coldplug = automount_coldplug,
775
776         .dump = automount_dump,
777
778         .start = automount_start,
779         .stop = automount_stop,
780
781         .serialize = automount_serialize,
782         .deserialize_item = automount_deserialize_item,
783
784         .active_state = automount_active_state,
785         .sub_state_to_string = automount_sub_state_to_string,
786
787         .check_gc = automount_check_gc,
788
789         .fd_event = automount_fd_event,
790
791         .bus_message_handler = bus_automount_message_handler,
792
793         .shutdown = automount_shutdown
794 };