I retract patch and recipe mentioned in the initial report. The problem is messier than I initially thought.
One fundamental consideration is that apparently systemctl won't start a service that is marked active, and won't stop a service that is marked inactive. This is inconsistent with longstanding initscript behavior, where you can start (or stop) something as many times as you like. 0) Simple question: Is there a way to teach the system to ignore the nominal state and just run ExecStart or ExecStop as directed? Maybe type=stateless rather than type=oneshot? This would make things a whole lot simpler. 1) Arguably "most" of the problem goes away if we document "restart" (as in "systemctl restart systemd-random-seed") as the proper way to refresh the seed. That leaves init.d/urandom in a bad state, because it knows nothing of "restart". 2) Here's another approach to consider: A paire of separate services: systemctl start systemd-random-seed-load and systemctl start systemd-random-seed-save The latter is /started/ (not stopped!) at shutdown time. Neither service has an ExecStop method. Neither service ever becomes active. Either one can be started as many times as desired, in any order. This is the only way I can think of to capture the semantics of the longstanding init.d/urandom script. The present systemd-random-seed script can trivially be reimplemented in terms of the new pair of services. This approach (2) would still require some changes to init.d/urandom, but not quite as ugly as approach (1) would require. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1652381 Title: systematic way to refresh the random-seed again and again To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1652381/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
