Re: Hooks for automount

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

 



On 14/03/2021 03:02, Patrick O'Callaghan wrote:
I assume there must be a basic error here, but I'm at a loss.

I like to crawl before I walk and walk before I run.

Even then, I see a pitfall in your plan.  So, I created a test /etc/systemd/system/dock.service.

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

[Service]
Type=oneshot
ExecStartPre=/usr/bin/mkdir -p /var/tmp/auto
ExecStart=/usr/bin/touch  /var/tmp/auto/start
ExecStop=/usr/bin/touch  /var/tmp/auto/stop

And notice the following......

[root@f33k ~]# ll /var/tmp/auto
ls: cannot access '/var/tmp/auto': No such file or directory

[root@f33k ~]# systemctl status dock.service
● dock.service - Power the dock up or down
     Loaded: loaded (/etc/systemd/system/dock.service; static)
     Active: inactive (dead)

[root@f33k ~]# systemctl start dock.service

[root@f33k ~]# ll /var/tmp/auto
total 0
-rw-r--r--. 1 root root 0 Mar 14 06:35 start
-rw-r--r--. 1 root root 0 Mar 14 06:35 stop

See the issue?

Your dock.service, if run, would power-up and then immediately power-down the dock.


--
People who believe they don't make mistakes have already made one.

_______________________________________________
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