I'm trying to create a service that runs at user login.
As a non-root user, I've created a file:
> cat ~/.local/share/systemd/user/voodoo.service
[Unit]
Description=User service test
[Service]
RemainAfterExit=yes
Type=simple
ExecStart=/bin/bash -c "touch /tmp/ok123"
[Install]
WantedBy=default.target
But, systemctl does not recognize it,
> systemctl --user restart voodoo.service
Failed to connect to bus: No such file or directory
Any ideas?
Best Answer
I think you have to
enable
the service first:As you can see, this simply create a symlink in the appropriate folder. Then I run:
and the service worked fine.