[systemd-devel] Mounting a partition at the *right* time

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Mon Jan 4 05:46:26 PST 2016


On Mon, Jan 04, 2016 at 04:25:14PM +0300, Andrei Borzenkov wrote:
> 04.01.2016 14:26, Rainer Dorsch пишет:
> > Hi,
> > 
> > I am facing an issue with a .mount unit file. The task is simple: mount a partition at the 
> > *right* time. 
> > 
> > The system is OpenElec 6.0, which is based on CoreOS. /etc/fstab is on a squashfs, i.e. 
> > it cannot be easily modified and is empty:
> > 
> > OpenELEC:~/.config/system.d # cat /etc/fstab
> > OpenELEC:~/.config/system.d # 
> > 
> > I would like to mount /storage/.kodi/.local/storage/sdcard after /storage is mounted 
> > and before systemd-tmpfiles-setup.service starts executing:
> > 
> > I created this .mount unit file:
> > 
> > OpenELEC:~/.config/system.d # cat storage-.kodi-.local-storage-sdcard.mount 
> > [Unit]
> > Description=sdcard mount script
> > 
> > #Requires=storage.mount
> > #After=storage.mount
> > ConditionPathExists=/storage/.kodi/.local/storage/sdcard
> > 
> > Conflicts=umount.target
> > Before=umount.target systemd-tmpfiles-setup.service
> > 
> 
> This creates dependency loop. systemd-tmpfiles-setup.service is ordered
> After local-fs.target and mount units by default are ordered Before
> local-fs.target.

No, that looks OK. It's *Before* s-tmpfiles-setup.service, so
there should be no loop.

Conflicts=umount.target, Requires=storage.mount, After=storage.mount
are added automatically, unless DefaultDependencies=false. So those
settings are not necessary but they should be harmless.

I don't see anything wrong in your setup... Can you paste the full
boot logs and
'systemctl show storage-.kodi-.local-storage-sdcard.mount'?

Zbyszek


More information about the systemd-devel mailing list