user service autostart

Joel Winarske

How does one enable a user service for a specific user at postinst?

User service in question is located in ${system_user_unitdir}.

Seems the problem is related to determining what user, which makes sense why this combo is not allowed: "systemctl --user --root=..."

I'm figuring this run as root?  Is there a way to have it run for a specific user?
systemd_postinst_ontarget () {
if [ "${SYSTEMD_AUTO_ENABLE}" = "enable" ]; then
for service in ${FLUTTER_USER_SERVICE_ESCAPED}; do
systemctl --user enable "$service"
systemctl --user start "$service"


Join to automatically receive all group messages.