[Ocfs2-tools-devel] [PATCH 2/6] ocfs2-tools: add systemd support

Zhen Ren zren at suse.com
Fri Jul 31 01:24:20 PDT 2015


Hi Junxiao,

As said previously, this patch works good, but a little issue.
That is the result of 'systemctl status ocfs2.service' always shows "FAILED" message while the
ISCSI volume succeed to mount at boot time. Like:
--
s1:~ # systemctl status ocfs2
ocfs2.service - Load ocfs2 Modules
   Loaded: loaded (/usr/lib/systemd/system/ocfs2.service; enabled)
   Active: failed (Result: exit-code) since Fri 2015-07-31 15:38:49 CST; 59s ago
  Process: 1403 ExecStart=/sbin/ocfs2.init start (code=exited, status=1/FAILURE)
 Main PID: 1403 (code=exited, status=1/FAILURE)

Jul 31 15:38:49 s1 ocfs2.init[1403]: Starting Oracle Cluster File System (OCFS2) mount: can't find UUID=6d735037-2e25-486a-a71f-1bc0b899093d
Jul 31 15:38:49 s1 ocfs2.init[1403]: ..failed

The config in /etc/fstab is:
--
UUID=6d735037-2e25-486a-a71f-1bc0b899093d /mnt/shared ocfs2 defaults,_netdev 0 0

The root case likely is the improper dependency of systemd service. The "_netdev" option tell kernel to do 
'mount -a -o _nedev' properly by waiting iscsid.service started. But ocfs2.service is still initiated earlier than iscsid.serce so that
iscsi volume cannot be found.

A solution is a little bit change of this patch. It works well for iscsi volume case, BUT I'm not sure if it's OK
for local fs, or other cases. 

THX.

> diff --git a/vendor/common/ocfs2.service b/vendor/common/ocfs2.service 
> new file mode 100644 
> index 0000000..768f806 
> --- /dev/null 
> +++ b/vendor/common/ocfs2.service 
> @@ -0,0 +1,14 @@ 
> +[Unit] 
> +Description=Load ocfs2 Modules 
> +Requires=o2cb.service 
> +After=o2cb.service 

After=remote-fs.target o2cb.service
> + 
> +[Service] 
> +Type=oneshot 
> +RemainAfterExit=yes 
> +ExecStart=/sbin/ocfs2.init start 
> +ExecStop=/sbin/ocfs2.init stop 
> +ExecReload=/sbin/ocfs2.init restart 
> + 
> +[Install] 
> +WantedBy=multi-user.target 



--
Eric, Ren






More information about the Ocfs2-tools-devel mailing list