systemd-ask-password fails when used in a user service. journalctl -xe output: > Apr 11 00:52:06 localhost systemd[458]: Starting ask password test... > -- Subject: Unit UNIT has begun with start-up > -- Defined-By: systemd > -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel > -- > -- Unit UNIT has begun starting up. > Apr 11 00:52:06 localhost systemd[458]: Started ask password test. > -- Subject: Unit UNIT has finished start-up > -- Defined-By: systemd > -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel > -- > -- Unit UNIT has finished starting up. > -- > -- The start-up result is done. > Apr 11 00:52:06 localhost systemd-ask-password[22495]: Failed to create password file: Permission denied > Apr 11 00:52:06 localhost systemd[458]: test-ask.service: main process exited, code=exited, status=1/FAILURE > Apr 11 00:52:06 localhost systemd[458]: Unit test-ask.service entered failed state. > Apr 11 00:52:06 localhost systemd[458]: test-ask.service failed. The unit I used to test: > [Unit] > Description=ask password test > > [Service] > Type=simple > ExecStart=/usr/bin/systemd-ask-password hi I started it with: > systemctl --user start test-ask.service Arch Linux, using systemd 218-2. My use case is I want to manually start up a password-protected daemon but have the resulting process managed by systemd, potentially pulling in dependencies, handling logging, etc.
This may be a simpler reproduction: ~$cat sap.sh #!/bin/bash nohup systemd-ask-password test & ~$./sap.sh ~$nohup: appending output to ‘nohup.out’ ~$cat nohup.out Failed to create password file: Permission denied
strace reports: open("/run/systemd/ask-password/tmp.QQJtvY", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0600) = -1 EACCES (Permission denied)
Let's continue tracking this RFE in github: https://github.com/systemd/systemd/issues/1232
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.