2013/3/5 <systemdki...@yopmail.com>

> Thank you Lennart. I wonder how your tip compares to our result? Our
> method employs getty.target and local-fs.target. It works but we prefer
> the Right Thing (tm). Would systemd-user-sessions.service be better for
> any reason? Here's our unit as it sits. Thanks for your input.
>
> # /etc/systemd/system/ramhome-setup.service
>
> [Unit]
> Description=Populate RAM user files from persistent store
> After=local-fs.target
>
> [Service]
> Type=oneshot
> ExecStart=/usr/bin/rsync --archive /home/ramhome/ /ramhome
> RemainAfterExit=no
>
> [Install]
> RequiredBy=getty.target
>
> After=local-fs.target is not needed, as this is implied in the default
dependencies.

Ordering against getty.target seems wrong, because it would theoretically
be possible to start a graphical or ssh session before your service
finishes. systemd-user-sessions.service ensures no user can log in until
then (It deletes the file /run/nologin, which is created very early).

Also, RemainAfterExit=no is the default, no need to include it

Mirco
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to