Use Systemd user services with ecryptfs

Tobias Wohlfarth

I want accomplish the following task: On a Ubuntu System with multiple Users accounts and encrypted Home directorys a NFS share should be mounted after login. I want to use systemd user service for this, but can't get it fully working.

What's working so far: - manual mount with user rights, configured with sudo - enabling the user service and starting it with systemctl --user start usermount.service

After a reboot systemd doesn't even know that this unit exists. I think there is a problem in combination with an encrypted $HOME (ecryptfs in my case), because the service unit and autostart configuration are located in .config/systemd/user/. My assumption is that the systemd user process is started immediatly after login, before decrypting the homedir and hence doesn't see the users configuration.

Whats my possibilities to solve this task?

Alexander

It's a bug in the ecryptfs package configuration. You can use a quick fix: Open /etc/pam.d/common-session and switch the lines

session optional        pam_systemd.so
session optional        pam_ecryptfs.so unwrap

to

session optional        pam_ecryptfs.so unwrap
session optional        pam_systemd.so

so that pam_systemd.so is loaded after pam_ecryptfs.so

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related