<div dir="ltr"><div><br></div><div>Hello</div><div><br></div><div>I have four unit files. </div><div><br></div><div>1. xxx.target</div><div>2. tmp-testy.mount</div><div>3. tmp-testy_ro.mount</div><div>4. temp-testy_rw.mount</div>
<div><br></div><div>I want the xxx.target to automatically start the three .mount unit files on boot. Item, 2. tmp-testy is a union mount of the two unit files 3. and 4. In order to get this to work,</div><div>I have to specify all three .mount files in the requires= and after= sections in the</div>
<div>.target unit file.</div><div><br></div><div>I was thinking that I would only need to specify item 2. in the xxx.target unit file and</div><div>that item 2. would specify it needed item 3 and 4. However this does not work. </div>
<div><br></div><div>Here are the contents of the four unit files, at the end is a unit file as it works and how I thought it would work, but alas is does not.</div><div><br></div><div><br></div><div>================================================</div>
<div>[root@xxx ~]# cat /lib/systemd/system/tmp-testy.mount</div><div>[Unit]</div><div>Description=The /tmp/testy unionfs Directory</div><div>Before=local-fs.target</div><div><br></div><div>[Mount]</div><div>What=funionfs#none</div>
<div>Where=/tmp/testy</div><div>Type=fuse</div><div>FsckPassNo=0</div><div>Options=dirs=/tmp/testy_ro=RO:/tmp/testy_rw,allow_other,nonempty</div><div>Requires=tmp-testy_ro.mount tmp-testy_rw.mount</div><div>After=tmp-testy_ro.mount tmp-testy_rw.mount</div>
<div>=================================================</div><div>[root@xxx ~]# cat /lib/systemd/system/tmp-testy_ro.mount</div><div>[Unit]</div><div>Description=Mount control of testy_ro Directory</div><div>Before=tmp-testy.mount</div>
<div><br></div><div>[Mount]</div><div>Where=/tmp/testy_ro</div><div>What=/tmp/mnt/hp_tools/Hewlett-Packard/HV/testy-ro.bin</div><div>Options=loop,ro</div><div>=================================================</div><div>[root@xxxx ~]# cat /lib/systemd/system/tmp-testy_rw.mount</div>
<div>[Unit]</div><div>Description=Mount control of testy_rw Directory</div><div>Before=tmp-testy.mount</div><div><br></div><div>[Mount]</div><div>Where=/tmp/testy_rw</div><div>What=tmpfs</div><div>Type=tmpfs</div><div>Options=size=1M,nr_inodes=1k,mode=755</div>
<div>=================================================</div><div>This works</div><div>[root@xxxx ~]# cat /lib/systemd/system/xxx.target</div><div>[Unit]<br></div><div>Description=xxxxx System</div><div>Documentation=man:systemd.special(7)</div>
<div>Requires=tmp-testy_rw.mount tmp-testy_ro.mount tmp-testy.mount etc.mount </div><div>Wants=sshd.service</div><div>After=tmp-testy_rw.mount tmp-testy_ro.mount tmp-testy.mount etc.mount </div><div>RefuseManualStart=yes</div>
<div>[root@xxx ~]#</div><div>This does not. It will mount /tmp/testy but /tmp/testy_ro and /tmp/testy_rw will not be mounted.</div><div><div>[root@xxxx ~]# cat /lib/systemd/system/xxx2.target</div><div>[Unit]<br></div><div>
Description=xxxxx System</div><div>Documentation=man:systemd.special(7)</div><div>Requires=tmp-testy.mount etc.mount </div><div>Wants=sshd.service</div><div>After=tmp-testy.mount etc.mount </div><div>RefuseManualStart=yes</div>
<div>[root@xxx ~]#</div></div><div><br></div>-- <br><div dir="ltr">John F. Davis<div>6 Kandes Court</div><div>Durham, NC 27713</div><div>919-888-8358</div><div><br>¶ÀÊ÷Ò»ÖÄ<br><br><br></div></div>
</div>