Systemd on vivid beta
Colin Law
clanlaw at gmail.com
Sat Mar 14 20:58:46 UTC 2015
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?
Colin
More information about the ubuntu-users
mailing list