As an experiment I am attempting to have some bind mounts created when a user logs in and then unmounted on log out. I have a working set of scripts but I would like to learn how to use systemd to control the actions.
My goal is to have all users have a set of private folders bind-mounted to their home at log in (not at boot-up) and disconnected when they log out. I used to be able to do this with X but since we're moving away from X soon to Wayland and systemd is new and powerful, I'd like to figure this one out. I've read dozens of pages and forums but nothing is complete or on-target.
Here's the systemd.service I tried:
I really have no clue what I'm doing.
My goal is to have all users have a set of private folders bind-mounted to their home at log in (not at boot-up) and disconnected when they log out. I used to be able to do this with X but since we're moving away from X soon to Wayland and systemd is new and powerful, I'd like to figure this one out. I've read dozens of pages and forums but nothing is complete or on-target.
Here's the systemd.service I tried:
Code:
[FONT=monospace][COLOR=#5454FF][B]/etc/systemd/system[/B][/COLOR][COLOR=#000000]$ cat bindmounts.service [/COLOR] [Unit] Description = Mount bindmounts After=network.target [Service] User=root Type=oneshot RemainAfterExit=true StandardOutput=journal ExecStart = /etc/systemd/user/bindin.sh Execstop = /etc/systemd/user/bindout.sh [Install] WantedBy=default.target [/FONT]
Comment