I have a user account on Ubuntu Server 17.10 with user lingering enabled for systemd, which is, in my opinion, a great function. However, it's poorly documented. While I've managed to start up my service as this user manually using
systemctl --user ... commands, I have a problem with dependencies.
~/.config/systemd/user/foobar.service I have the dependency set this way:
[Unit] Decription=StackExchange Foo Bar After=network.target # Some non-relevant stuff removed [Install] WantedBy=default.target
When I put
posgresql.service it fails saying it doesn't know that one. I figured out in other answers, that lingered systemd doesn't see system-wide services. Only generic systemd targets, hence WantedBy should be set to
default.target. But with that setting, the service (real application) itself fails to start on boot, as it cannot connect to the system-wide Postgresql [in time?].
So, the real question here is: How to setup all that in lingering mode, to have the working dependency on PosgreSQL at every boot? Any way to setup dummy
postgreql.service that would link to the system one somehow? Are there any other methods? Any hint would be welcome.
EDIT: Postgresql is running as a system-wide application, not a service via a user account.