Re: [systemd-devel] systemd automounts

2011-08-02 Thread Mirco Tischler
2011/8/2 Steve Dickson ste...@redhat.com:


 On 08/01/2011 09:10 PM, Mirco Tischler wrote:
 Hi
 2011/8/2 Steve Dickson ste...@redhat.com:

 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.

 The attached output indicates that your automount unit isn't started,
 and I can't see anything causing it to start in your unit files
 either. You can verify this with systemctl status
 var-lib-nfs-rpc_pipefs.automount.
 It appears you are correct. systemctl status var-lib-nfs-rpc_pipefs.automount
 show the status not being started.

 Note that After= is only an ordering information and doesn't cause the
 unit to be started. Only if the automount is started anyway through
 some other path, the After= line causes the service to wait until the
 automount point is started.You may need to add a line
 Wants=var-lib-nfs-rpc_pipefs.automount to your service file.

 Does that help you?
 Adding that wants does start var-lib-nfs-rpc_pipefs.automount but
 now I'm getting two mounts...

 # mount | grep rpc
 systemd-1 on /var/lib/nfs/rpc_pipefs type autofs 
 (rw,relatime,fd=16,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
 sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)

 or is that normal for automounts?

 steved.

Yup that's normal. the systemd-1 is the automount point.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd automounts

2011-08-02 Thread Steve Dickson


On 08/02/2011 08:55 AM, Mirco Tischler wrote:
 2011/8/2 Steve Dickson ste...@redhat.com:


 On 08/02/2011 04:35 AM, Mirco Tischler wrote:
 2011/8/2 Steve Dickson ste...@redhat.com:


 On 08/01/2011 09:10 PM, Mirco Tischler wrote:
 Hi
 2011/8/2 Steve Dickson ste...@redhat.com:

 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.

 The attached output indicates that your automount unit isn't started,
 and I can't see anything causing it to start in your unit files
 either. You can verify this with systemctl status
 var-lib-nfs-rpc_pipefs.automount.
 It appears you are correct. systemctl status 
 var-lib-nfs-rpc_pipefs.automount
 show the status not being started.

 Note that After= is only an ordering information and doesn't cause the
 unit to be started. Only if the automount is started anyway through
 some other path, the After= line causes the service to wait until the
 automount point is started.You may need to add a line
 Wants=var-lib-nfs-rpc_pipefs.automount to your service file.

 Does that help you?
 Adding that wants does start var-lib-nfs-rpc_pipefs.automount but
 now I'm getting two mounts...

 # mount | grep rpc
 systemd-1 on /var/lib/nfs/rpc_pipefs type autofs 
 (rw,relatime,fd=16,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
 sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)

 or is that normal for automounts?

 steved.

 Yup that's normal. the systemd-1 is the automount point.
 Thanks for this tip... but things are still no quite right...

 the Starting RPC Pipe File System (i.e. the mount of  
 /var/lib/nfs/rpc_pipefs)
 was happening later than the Starting Name to UID/GID mapping for NFSv4
 (i.e. the nfs-idmap.service) so I added back the 
 After=var-lib-nfs-rpc_pipefs.automount
 line nfs-idmap.service which didn't seem to work... Looking at the booting 
 messages,
 the nfs-idmap.service is still being started before the automount.

 How I do I guarantee the automount happens and finish before 
 nfs-idmap.service
 is started?
 This is not how automount works. The real fs is only mounted when the
 first acces is done which is of cause
 after the service begins to start. The access is then blocked until
 the fs is mounted.
 However I'm starting to think automount isn't what you want at all.
 Your nfs-idmap.service is started on boot and needs the rpc fs during
 service startup so it doesn't make a lot of sense to delay the start
 of the service with an automount point. Automount is more useful IMO
 when the fs isn't usually used during boot.
 Why don't you discard the automount unit and instead reference the
 actual mount unit in your service file with After= and Wants= lines.
 Does that make sense to you?
Yes it does and changing the mount from an automount to an actual mount
did fix the problem... Thank you very much!

There is an oddity though... I noted the var-lib-nfs-rpc_pipefs.mount actually
failed 

systemctl status var-lib-nfs-rpc_pipefs.mount
var-lib-nfs-rpc_pipefs.mount - RPC Pipe File System
  Loaded: loaded (/lib/systemd/system/var-lib-nfs-rpc_pipefs.mount)
  Active: active (mounted) since Tue, 02 Aug 2011 09:35:31 -0400; 1min 
56s ago
   Where: /var/lib/nfs/rpc_pipefs
What: sunrpc
 Process: 857 ExecMount=/bin/mount sunrpc /var/lib/nfs/rpc_pipefs -t 
rpc_pipefs -o rw,relatime (code=exited, status=32)
  CGroup: name=systemd:/system/var-lib-nfs-rpc_pipefs.mount

But file system was mounted maybe cause the fs is already mounted? I 
rebooted
a couple times and the service continually comes up so I'm moving on..  

Again, thanks for your help Its most definitely appreciated!

steved.
 

 Also now when I reboot the system hangs for a bit due to the following
 problem:

 [  272.510946] systemd[1]: var-lib-nfs-rpc_pipefs.mount mounting timed out. 
 Killing.
 [  362.511271] systemd[1]: var-lib-nfs-rpc_pipefs.mount mount process still 
 around after SIGKILL. Ignoring.
 [  362.609307] systemd[1]: Unit var-lib-nfs-rpc_pipefs.mount entered failed 
 state.

 So it appears the ordering of the shutdown is not quite right either...
 I'm not sure if this is the problem but you have
 DefaultDependencies=no in your unit files. Do you really need this? If
 yes you might need to add Conflicts=shutdown.target to make this work

 steved.
 
 Mirco
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd automounts

2011-08-01 Thread Steve Dickson


On 08/01/2011 05:43 PM, Lennart Poettering wrote:
 On Fri, 29.07.11 11:16, Steve Dickson (ste...@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.
dev-hugepages.automount   loaded active waiting   Huge Pages File System 
Automount Point
dev-mqueue.automount  loaded active waiting   POSIX Message Queue File 
System Automount Point
proc-sys...misc.automount loaded active waiting   Arbitrary Executable File 
Formats File System Automount Point
sys-kern...ebug.automount loaded active waiting   Debug File System 
Automount Point
sys-kern...rity.automount loaded active waiting   Security File System 
Automount Point
sys-devi...ock-sr0.device loaded active plugged   QEMU_DVD-ROM
sys-devi...et-eth0.device loaded active plugged   
/sys/devices/pci:00/:00:03.0/virtio0/net/eth0
sys-devi...d-card0.device loaded active plugged   
/sys/devices/pci:00/:00:04.0/sound/card0
sys-devi...da-vda1.device loaded active plugged   
/sys/devices/pci:00/:00:05.0/virtio1/block/vda/vda1
sys-devi...da-vda2.device loaded active plugged   
/sys/devices/pci:00/:00:05.0/virtio1/block/vda/vda2
sys-devi...ock-vda.device loaded active plugged   
/sys/devices/pci:00/:00:05.0/virtio1/block/vda
sys-devi...y-ttyS0.device loaded active plugged   
/sys/devices/platform/serial8250/tty/ttyS0
sys-devi...y-ttyS1.device loaded active plugged   
/sys/devices/platform/serial8250/tty/ttyS1
sys-devi...y-ttyS2.device loaded active plugged   
/sys/devices/platform/serial8250/tty/ttyS2
sys-devi...y-ttyS3.device loaded active plugged   
/sys/devices/platform/serial8250/tty/ttyS3
sys-devi...dm\x2d0.device loaded active plugged   
/sys/devices/virtual/block/dm-0
sys-devi...dm\x2d1.device loaded active plugged   
/sys/devices/virtual/block/dm-1
sys-devi...dm\x2d2.device loaded active plugged   
/sys/devices/virtual/block/dm-2
sys-devi...dm\x2d3.device loaded active plugged   
/sys/devices/virtual/block/dm-3

[systemd-devel] systemd automounts

2011-07-29 Thread Steve Dickson
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

var-lib-nfs-rpc_pipefs.automount is:
[Unit]
Description=RPC Pipe File System
DefaultDependencies=no

[Automount]
Where=/var/lib/nfs/rpc_pipefs

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

[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:

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?

tia...

steved.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel