Open SohKa opened 4 years ago
A bit more context about my need :
In my custom script (so almost at the end of the hypercube.sh
execution), I automated the move of the root (/
) filesystem from the SD card to the SATA drive (if plugged). Before doing the rsync
of the whole system, I want to make sure every non-essential applications are stopped.
So I created a systemd target unit to stop every services but the hypercube.service
and the ssh.service
ones (systemctl isolate hypercube.target
). The problem is here. systemd is waiting the hypercube.service
to be activated. But it never does because of the issue I explained in my first post. Changing the type of the systemd service hypercube.service
from oneshot
to simple
would fix my problem.
I realize my explanations are maybe a bit obscure (especially if one doesn't know about basic concept of systemd units). If you need clarifications, don't hesitate to ask ! :)
I'm currently refactoring hypercube.sh and I notice this
which is part of your problem I think because we never know when the hypercube installation is done on systemd point of view.
So good fix would be to split the web log server in an other service type simple and have the installation step as oneshot without all the sleep crap.
Indeed, independently of my issue, it would be nice that the web log server would have his own service.
If you implement this, I think this PR could be closed.
Hi !
I was doing some experiments with the
hypercube.sh
script and I noticed its systemd service never goes in active state. The reason is : because the service unit is of the oneshot type, the state isactivating (start)
during the execution (once it has successfully ran, it directly goes toinactive (dead)
).But I can not find a reason for this. No service needs to wait for it to finish its execution before being started (like the
hypercube.sh
depends onfirstrun.service
andsecondrun.service
) since it does the cube's setup until the end. Plus, since it provides a web server (SimpleHTTPServer
), I think thehypercube.sh
script isn't just a regular one-task shell script.Thus, I think the type
simple
(as set in this PR) would be more convenient for this service.I tested this change by reinstalling from scratch my lime2.