Re: Hooks for automount

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

 



On Sun, 2021-03-14 at 07:37 +0800, Ed Greshko wrote:
> > > Your dock.service, if run, would power-up and then immediately
> > > power-down the dock.
> > Indeed. Does that mean I need separate dock-up and dock-down
> > services?
> 
> I suppose.  But, I can't say that there is a way to start a service
> went the auto-unmount occurs.

That is starting to look like the show-stopper. The only way round it
may be a separate monitoring process outside of systemd.

Anyway, taking one thing at a time, I have the dock permanently on
while I try to get the automounting to work:

> > Also, the .service is not being invoked by the .mount (I shouldn't
> > have
> > to start it manually), presumably because the .automount isn't
> > running.
> 
> I modified my aux.mount unit to be
> 
> [Unit]
> Description=nfs mount aux
> Wants=dock.service
> 
> [Mount]
> What=[2001:b030:112f::19]:/volume1/aux
> Where=/aux
> Options=rw,noauto,soft,fg,x-systemd.mount-timeout=30
> Type=nfs4
> 
> [Install]
> WantedBy=multi-user.target

My raid.mount now looks like this (the previous version was missing the
'What' and 'Options' lines):

# cat raid.mount 
   [Unit]
   Description=External /raid mount
   
   Wants=dock.service
   
   [Mount]
   What=/dev/md0p1
   Where=/raid
   Options=rw,noauto,soft,fg,x-systemd.mount-timeout=30
   Type=ext4
   
   [Install]
   WantedBy=multi-user.target
   
Everything else is the same. Recall that the .automount file is:

# cat raid.automount 
   [Unit]
   Description=Automount /raid
   [Automount]
   Where=/raid
   TimeoutIdleSec=300
   
   [Install]
   WantedBy=multi-user.target
   
and dock.service is:

# cat dock.service
   [Unit]
   Description=Power the dock up
   After=multi-user.target
   DefaultDependencies=no
   
   [Service]
   #Type=oneshot
   ExecStart=/usr/local/bin/dock up
   
I commented out the 'Type=oneshot' line as this is the default. I could
add 'RemainAfterExit=on' in order to keep the state as 'running but I
don't see that this makes any material difference here.

It then rebooted and.....

[egreshko@f33k ~]$ ll /var/tmp/auto/
total 0
-rw-r--r--. 1 root root 0 Mar 14 07:26 start
-rw-r--r--. 1 root root 0 Mar 14 07:26 stop

I rebooted and got:

# findmnt /raid
# ls /raid
# findmnt /raid
#

IOW nothing happens.

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