You are not logged in.

#1 2015-07-19 14:40:26

Arakis
Member
From: Hamminkeln - Germany
Registered: 2013-08-11
Posts: 46
Website

Custom mount script

Hello,
is there any way to to call a script:

* before
and
* after

the systemd fs mounts (from fstab)? Like "init_bottom" from initd. Maybe this is possible via a .service file, but wich triggers i have to set ("RequiedBy" and so), that it will be called in the right moment?

Or, would be there a way to replace fstab and make a own mount script?

Greetings,
Sebastian

Last edited by Arakis (2015-07-19 14:40:49)

Offline

#2 2015-07-19 15:03:32

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Custom mount script

What are you trying to do?
Read the wiki, maybe it has answers to your questions.

Offline

#3 2015-07-19 15:25:41

Arakis
Member
From: Hamminkeln - Germany
Registered: 2013-08-11
Posts: 46
Website

Re: Custom mount script

Already done, but i do not know the name of "Requires=" to trigger my systemd unit immediately after the fs-mount, so i can overlay specific directories.

I need to have a pure RO system, with RW to a tmpfs / other partition.

Is i read here ( http://www.freedesktop.org/software/sys … mount.html ) i can use x-systemd.requires. In the moment, the root-file-system is mounted and the fstab is processed/mount units will generated and mounted, are there already running processes, that have file / Inode-references to /var, /usr, /etc? Because i want to overlay them in-place (overshadow) (for example: /var (rw) = overlayfs original /var (ro) + /tmp/var (rw)).

I'm not sure, if my way is correct.

Last edited by Arakis (2015-07-19 15:29:09)

Offline

#4 2015-07-19 22:35:41

Arakis
Member
From: Hamminkeln - Germany
Registered: 2013-08-11
Posts: 46
Website

Re: Custom mount script

I use now a fuse mount within the fstab and use the x-systemd.requires option.

But in this moment, there are still processes, that opend write files.

For example:
/var/log/journal/...., a file is opend, even during the fstab-mount moment. When i overshadow /var now with an overlayfs overlay, (it generally works), journald complaints about "Invalid Argument" when accessing its /var/log/journal/... file. Even a service restart does not help. I solve "this" case now by Storage=volatile in the journald.conf, but this is only a workarround.

Another problem was, when there is a Xorg.log (owned by root), X-Server complaints about "unable to move xorg.log to xorg.log.old". Wheni do this step by hand, it works. It works generally when not using an overlay.

Offline

Board footer

Powered by FluxBB