You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 6, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 6, 2026. It is now read-only.
Targeted systemd implementation with /etc configuration #91
We can adapt our systemd implementation to be more in line with normal systemd services.
As a user/system admin, I prefer reading a simple script in /etc/init.d/kolibri to understand how to run and configure a system service.
As a developer/maintainer, I prefer systemd as it is easier to define services, and we can remove all of kolibri's daemon behavior.
But in light of issues ( #90 ) with the systemd daemon, we could want to maintain a pattern that separates the sysvinit script from systemd and lets systemd manage Kolibri as a New-style daemon.
Example
Here's how simple Kolibri's service file could be, given that we just let systemd manage everything:
What doesn't work in this example is that systemd will kill and respawn Kolibri too fast when it does reloads. Kolibri won't be able to re-bind to its TCP port that quickly.
A full implementation
Systemd is designed with patterns for users to override distributed files, e.g. sudo systemctl edit --full kolibri will create a local replacement, and sudo systemctl edit kolibri will amend to the distributed configuration. These are patterns that maybe people will get more used to in the future, as opposed to editing /etc/init.d/kolibri and such anti-patterns.
We can keep the service's user configuration in /etc/kolibri such that it's shared with.
/etc/default/kolibri stops being used.
/etc/kolibri/conf.d to ONLY support setting environment variables. Essentially nothing changes since we never documented anything else than setting the environment there.
Ensure that sudo service kolibri start also uses the systemd service. CLARIFY
Kolibri could adapt to being supervised, like for instance redis --supervised. Maybe we can just use --foreground or make an alias --supervised which we adapt in case behavior changes later.
Load user added environment: EnvironmentFile=/etc/kolibri/conf.d/*.confUNCHANGED
Set User and Group in [Services]: /etc/systemd/system/kolibri.service.d/user.confexample. This would mean to either stop using /etc/kolibri/username and/or add a utility script that moves it CHANGED
If implementing a more clean systemd version, we should also consider to add calls to kolibri manage migrate to install / upgrade processes in postinst, before starting the service. This can ensure that Kolibri doesn't need migrations while systemctl start kolibri is waiting for the process to fork.
Closing as stale ahead of archiving this repository. The Debian package now lives in the Kolibri monorepo; please open a fresh issue on learningequality/kolibri if this is still wanted.
Activity
Follow-up on learningequality#91 to use `su` for Ubuntu 14.04
benjaoming commentedon Apr 14, 2020
Related: #85
benjaoming commentedon Apr 15, 2020
Related: #66
If implementing a more clean systemd version, we should also consider to add calls to
kolibri manage migrateto install / upgrade processes in postinst, before starting the service. This can ensure that Kolibri doesn't need migrations whilesystemctl start kolibriis waiting for the process to fork.rtibbles commentedon Oct 4, 2026
Closing as stale ahead of archiving this repository. The Debian package now lives in the Kolibri monorepo; please open a fresh issue on learningequality/kolibri if this is still wanted.