[systemd-devel] systemd automounts

Steve Dickson SteveD at redhat.com
Mon Aug 1 17:59:06 PDT 2011



On 08/01/2011 05:43 PM, Lennart Poettering wrote:
> On Fri, 29.07.11 11:16, Steve Dickson (SteveD at redhat.com) wrote:
> 
>> I'm trying to automount /var/lib/nfs/rpc_pipefs
>> for the nfs-idmap.service
>>
>> var-lib-nfs-rpc_pipefs.mount is:
>> [Unit]
>> Description=RPC Pipe File System
>> DefaultDependencies=no
>>
>> [Mount]
>> What=sunrpc
>> Where=/var/lib/nfs/rpc_pipefs
>> Type=rpc_pipefs
> 
> Looks good.
> 
>>
>> var-lib-nfs-rpc_pipefs.automount is:
>> [Unit]
>> Description=RPC Pipe File System
>> DefaultDependencies=no
>>
>> [Automount]
>> Where=/var/lib/nfs/rpc_pipefs
> 
> Looks good, too. But I'd recommend adding After=local-fs.target here, to
> ensure your automount unit is established after /var is, if that's on a
> separate partition.
Added.

> 
>> and the nfs-idmap.service is:
>> [Unit]
>> Description=Name to UID/GID mapping for NFSv4.
>> After=syslog.target network.target var-lib-nfs-rpc_pipefs.automount
>> ConditionPathIsDirectory=/sys/module/sunrpc
> 
> Is this really dependent on the network? If not I'd recommend to
> ordering this after network.target.
No, so I removed the network.target.

> 
> Also, in F16 we will no longer support non-socket-activated syslogs (all
> existing implementations have support for socket actviation upstream),
> so the After=syslog.target is not necessary anymore.
Ok. I remove the syslog.target  so the after line is:
  After=var-lib-nfs-rpc_pipefs.automount 

> 
>> [Service]
>> Type=forking
>> EnvironmentFile=-/etc/sysconfig/nfs
>> ExecStart=/usr/sbin/rpc.idmapd $RPCIDMAPDARGS
>>
>> [Install]
>> WantedBy=multi-user.target
>>
>> Now I know for a fact that /var/lib/nfs/rpc_pipefs
>> is being mount *after* the nfs-idmap.service 
>> is run, because:
> 
> being mounted?
Yes. Once the machine comes up the 
   sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)

mount exists. But its not being mounted soon enough because for 
the nfs-idmap.service. 

> 
> You mean the automount point being established, not the backing mount, right?
I'm not sure what you are asking me.

> 
>> rpc.idmapd is failing because 
>>      rpc.idmapd[819]: main: open(/var/lib/nfs/rpc_pipefs//nfs): No such file or
>> directory
>>
>> and the startup message clearly show the service is being
>> run before the mount:
>>
>> Starting Name to UID/GID mapping for NFSv4....
>> Starting OpenSSH server daemon....
>> Started OpenSSH server daemon..
>> Starting RPC bind service...
>> Starting Sendmail Mail Transport Agent...
>> Started LSB: Mount and unmount network filesystems..
>> [   25.803165] RPC: Registered named UNIX socket transport module.
>> [   25.804236] RPC: Registered udp transport module.
>> [   25.805327] RPC: Registered tcp transport module.
>> [   25.806283] RPC: Registered tcp NFSv4.1 backchannel transport module.
>> [   25.889822] SELinux: initialized (dev rpc_pipefs, type rpc_pipefs), uses genfs_contexts
>>
>> So any idea what on what I'm doing wrong? Is this how autmounts are
>> suppose be used?
> 
> Yes, this looks like a good usecase.
> 
> Hmm, does the automount point work after boot?
It seems so, because if I restart nfs-idmap.service the 
service comes up.

> 
> How does the output of "systemctl list-units" look like for the
> automount and mount unit?
> 
attached.

steved.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: list-units
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20110801/d4e8b9ee/attachment.ksh>


More information about the systemd-devel mailing list