Systemd on vivid beta

Colin Law clanlaw at gmail.com
Sat Mar 14 22:06:10 UTC 2015


On 14 March 2015 at 21:32, Tom H <tomh0665 at gmail.com> wrote:
> On Sat, Mar 14, 2015 at 4:58 PM, Colin Law <clanlaw at gmail.com> wrote:
>> On 14 March 2015 at 20:08, Tom H <tomh0665 at gmail.com> wrote:
>>> ...
>>> Should you want to switch to a .mount unit, I've set up the following
>>> in a VM (192.168.1.11 is my laptop) and rebooted.
>>>
>>> <begin>
>>> # systemctl cat home-th-srvtom.mount
>>> # /etc/systemd/system/home-th-srvtom.mount
>>> [Unit]
>>> Before=remote-fs.target
>>>
>>> [Mount]
>>> What=//192.168.1.11/srvtom
>>> Where=/home/th/srvtom
>>> Type=cifs
>>> Options=credentials=/home/th/.cifscreds
>>>
>>> [Install]
>>> WantedBy=multi-user.target
>>>
>>> # systemctl status home-th-srvtom.mount
>>> ● home-th-srvtom.mount - /home/th/srvtom
>>>    Loaded: loaded (/etc/systemd/system/home-th-srvtom.mount; enabled;
>>> vendor preset: enabled)
>>>    Active: active (mounted) since Sat 2015-03-14 15:56:47 EDT; 1min 47s ago
>>>     Where: /home/th/srvtom
>>>      What: //192.168.1.11/srvtom
>>>   Process: 554 ExecMount=/bin/mount //192.168.1.11/srvtom
>>> /home/th/srvtom -n -t cifs -o credentials=/home/th/.cifscreds
>>> (code=exited, status=0/SUCCESS)
>>>
>>> Mar 14 15:56:47 localhost systemd[1]: Mounting /home/th/srvtom...
>>> Mar 14 15:56:47 localhost systemd[1]: Mounted /home/th/srvtom.
>>> </end>
>>>
>>
>> Thanks Tom.
>> Will that automatically mount/unmount if the server comes and goes?
>
> Yes. With ifupdown and NM. I haven't tested it with networkd but I
> assume that it'll be ordered properly with it too.

I will have to give that a go.  Though my script is now working fine
as I don't generally use wifi on this machine.  Simpler for the future
than messing about with scripts though.

Thanks

Colin




More information about the ubuntu-users mailing list