[systemd-devel] systemd kiosk volatile $HOME

Lennart Poettering lennart at poettering.net
Fri Mar 1 03:46:46 PST 2013


On Wed, 27.02.13 06:47, systemdkiosk at yopmail.com (systemdkiosk at yopmail.com) wrote:

> Here's the question (systemd version 197).
> 
>      https://bbs.archlinux.org/viewtopic.php?pid=1237019
> 
> Might the answer involve two units, a mount and a service? Thanks much.

I am not sure I get the full problem. But if this is about simply
mounting a tmpfs to /home at boot, and making sure rsync runs before the
first user can log in, then simple list the tmpfs in /etc/fstab and
create a service file like this in /etc/systemd/system/my-rsync.service:

[Unit]
Before=systemd-user-sessions.service

[Service]
Type=oneshot
ExecStart=/usr/bin/rsync ...

And then pull this in from multi-user.target:

ln -s /etc/systemd/system/my-rsync.service /etc/systemd/system/multi-user.target.wants/

And that should be it. systemd-user-sessions.service is a special
service that is run before all user sessions. It removes /run/nologin
and suchlike thus actually allowing user logins. If you run your stuff
before that service, then you can be sure it has to finish before the
first login takes place.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list