Closed giovannipizzi closed 5 years ago
Re 1.: agreed!
Re 2.: ok, whatever you think is the right solution
Re 3.: I agree having two ways of controlling the daemon can be an issue.
One could view it as two different use cases (an aiida "server" vs a tutorial machine).
What about adding a aiida_daemon_service
variable that determines whether the service is added (potentially also a aiida_daemon_service_autostart
that allows you to have the service but not have it started at boot)?
For the quantum mobile we probably don't even need the service since we want people to learn how to use aiida on their own.
A few notes for discussion:
After=network.target postgresql.service
should now becomeAfter=network.target postgresql.service rabbitmq-server.service
(TESTED: otherwise the daemon starts before rabbitmq and if fails). NOTE: do the same also in theaiida-rest.service
(to be on the safe side)Sockets=
directive is wrong, I think: according to the man, it should be a "unit" i.e. a file describing the socket like, e.g.,system/sockets.target.wants/acpid.socket
. We are instead pointing to a text file that contains the path of a folder in which there are three socket filescircus.?.sock
(and actually the path is wrong because it also contains a/log/
subfolder). So this will not work. Indeed at boot I get:PIDFile=
pointing tocircus-default.pid
(note to remove the /log/ component of the path). I tried and it works. However (but I'm not sure of this) does this mean that the service will try to keep the daemon running, so if you doverdi daemon stop
by hand, after 60 seconds it will restart it without the user knowing (I imagine this is the role of theRestart=
section? Do we want this? (Even if I'm not sure this is happening, I cannot see this, I see some information insudo systemctl status aiida-daemon
but it does not restart). [EDIT: I think thatverdi daemon stop
makes the process end with a0
exit code, and since the policy ison-failure
, this will not restart it - so maybe this is the right thing to do; even if, if the user restarts the daemon from the command line,systemctl
will not notice the new daemon...]@ltalirz if you agree with the changes above I'll make them