[arch-general] systemd automount + wake-on-lan dependency
Sander Jansen
s.jansen at gmail.com
Sat Jan 12 20:55:41 EST 2013
On Thu, Jan 10, 2013 at 6:38 AM, Martín Cigorraga <msx at archlinux.us> wrote:
> >
> > > On 01/08/2013 05:39 PM, Sander Jansen wrote:
> > > > I want my media pc to automatically mount several samba shares when
> > > they're
> > > > accessed.
> >
> >
> Is that even possible? Because the way Samba protocol works it might be
> some time
> (as much as some good 10 minutes, may be a little more) until the shares
> are up and
> ready to be accessed on the network. This is not the case with NFSv4 in
> which case
> AutoFS will find and mount instantly any share providing the NFS server is
> up, of course.
> OTOH if the NFS server is down when you try to access it via AutoFS the NFS
> client
> on your machine will initiate the Stall of Death, but that's another song
> :p
>
>
I don't know. For me it works pretty quickly. Haven't noticed any giant
delays.
> > Good news was that I was able to get a systemd share.mount unit working
> > with a wol.service unit. Starting the mount unit will correctly start the
> > wol.service unit and wake the machine using the magic packet. What I
> > haven't got working is the automount: So far it only tries to mount the
> > share, but not activate the wol.service unit. Perhaps the automount units
> > also needs to depend on the wol.service?
>
>
> > Sander
> >
>
> Since I'm migrating my network shares everywhere from NFS to Samba (the
> later being
> slower but more reliable) I'm most interested in the work you've done, can
> you post the
> units back?
>
I'm still suffering from the suspend/problem I mentioned before (although
not all the time), but so far I have the following units files and as long
my computer resumes fine, it all seems to work:
wol-anathem.service:
---------------------------
[Unit]
Description=Wake-on-Lan Anathem
Requires=network.target
[Service]
ExecStart=/usr/bin/wol MACADDRESS
Type=oneshot
mnt-anathem.mount:
---------------------------
[Mount]
What=//ANATHEM/mysharename
Where=/mnt/anathem
Type=cifs
Options=ip=192.168.1.42,sec=none
[Unit]
Requires=wol-anathem.service
After=wol-anathem.service
mnt-anathem.automount:
---------------------------
[Automount]
Where=/mnt/anathem
[Unit]
Requires=wol-anathem.service
After=wol-anathem.service
More information about the arch-general
mailing list