Re: Hooks for automount

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2021-03-13 at 08:49 -0500, Jonathan Billings wrote:
> On Mar 12, 2021, at 19:05, Ed Greshko <ed.greshko@xxxxxxxxxxx> wrote:
> > 
> > I don't think systemd was meant to solve these sorts of issues
> 
> Honestly, systemd is more equipped to handle this kind of issue than any init system before it.  Being able to attach dependencies in a .mount unit to a .service unit is something that would have required a bunch of hacks or the autofs service.  
> 
> I use a network filesystem every day that has a .mount unit that requires a .service to be launched before it can be mounted (kAFS, see kafs-utils package).  It isn’t as complicated as the usb power on/off, but not outside of the realm of possibility.

I modified the .mount and .service files from kasf-client, and added a
.automount file. I also commented out the appropriate line in
/etc/fstab.

# cat raid.mount 
[Unit]
Description=External raid mount
ConditionPathExists=/raid
Wants=dock.service

[Mount]
What=none
Where=/raid
Type=ext4

[Install]
WantedBy=local-fs.target

# cat dock.service
[Unit]
Description=Power the dock up or down
After=local-fs.target
DefaultDependencies=no

[Service]
Type=oneshot
#ExecStartPre=/sbin/modprobe -q kafs
ExecStart=/usr/local/bin/dock up
ExecStop=/usr/local/bin/dock down

# cat raid.automount 
[Unit]
Description=Automount /raid
[Automount]
Where=/raid
TimeoutIdleSec=300

[Install]
WantedBy=multi-user.target

I then rebooted:
# findmnt /raid
# # systemctl list-units|egrep dock\|raid
  raid-check.timer  	loaded active waiting   Weekly RAID setup health check (not relevant here)                                                                         

So nothing I did appears to have had any effect. The
/usr/local/bin/dock script, which logs its activity, is not being
called. The raid.automount is not running, and attempting to access the
/raid directory does nothing. There is nothing related to either 'dock'
or 'raid' in the journal.

I assume there must be a basic error here, but I'm at a loss.

poc
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux