| Summary: | Add 'koha-common.service' systemd service | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Mason James <mtj> |
| Component: | Packaging | Assignee: | Bugs List <koha-bugs> |
| Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
| Severity: | normal | ||
| Priority: | P5 - low | CC: | dcook, fridolin.somers, jonathan.druart, martin.renvoize, mtj, nugged, tomascohen |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | --- |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: |
23.11.00,23.05.00,22.11.07
|
|
| Circulation function: | |||
| Attachments: |
Bug 33371: Add 'koha-common.service' systemd service
Bug 33371: Add 'koha-common.service' systemd service Bug 33371: Add [Install] section to koha-common.service Bug 33371: Add [Install] section to koha-common.service [PATCH] Bug 33371: Add [Install] section to koha-common.service Bug 33371: Add [Install] section to koha-common.service |
||
|
Description
Mason James
2023-03-30 14:25:23 UTC
Created attachment 149060 [details] [review] Bug 33371: Add 'koha-common.service' systemd service to test - install current package - note following $message on install 'Failed to enable unit: Unit /run/systemd/generator.late/koha-common.service is transient or generated.' - apply patch, build package, install new package - note $message is gone! :) - test koha-common.service # systemctl start koha-common # systemctl status koha-common | grep running Active: active (running) since Sun 2023-04-02 00:27:31 NZDT <<< # systemctl stop koha-common # systemctl status koha-common | grep dead Active: inactive (dead) since Sun 2023-04-02 00:25:34 NZDT <<< Created attachment 151474 [details] [review] Bug 33371: Add 'koha-common.service' systemd service to test - install current package - note following $message on install 'Failed to enable unit: Unit /run/systemd/generator.late/koha-common.service is transient or generated.' - apply patch, build package, install new package - note $message is gone! :) - test koha-common.service # systemctl start koha-common # systemctl status koha-common | grep running Active: active (running) since Sun 2023-04-02 00:27:31 NZDT <<< # systemctl stop koha-common # systemctl status koha-common | grep dead Active: inactive (dead) since Sun 2023-04-02 00:25:34 NZDT <<< Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Pushed to master for 23.05. Nice work everyone, thanks! I don't know about this one... It feels hacky and yet it should work. On one hand, it would be nice to convert from the SysV init script to a Systemd unit. On the other hand, Systemd doesn't work well for containers. Maybe we should have a script or scripts that are called by either the SysV init, Systemd, or whatever management program we choose. That's for the future though I think... PROBLEM! On my Ubuntu 20.04 LTS it doesnt comes up after REBOOT (!!!).
So I need manually run "service koha-common start".
AFTER REBOOT:
#> service koha-common status
● koha-common.service - Start required services for each Koha instance
Loaded: loaded (/etc/init.d/koha-common; enabled; vendor preset: enabled)
Active: inactive (dead)
I found that on my server koha-common.service lacks for
[Install]
WantedBy=multi-user.target
without this, it dies:
#> systemctl enable koha-common
```
Synchronizing state of koha-common.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable koha-common
The unit files have no installation config (WantedBy=, RequiredBy=, Also=,
Alias= settings in the [Install] section, and DefaultInstance= for template
units). This means they are not meant to be enabled using systemctl.
```
and with "Install" block it now ok:
#> systemctl enable koha-common
```
Synchronizing state of koha-common.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable koha-common
Created symlink /etc/systemd/system/multi-user.target.wants/koha-common.service → /lib/systemd/system/koha-common.service.
```
And on reboot now I have it ALIVE!
#> service koha-common status
● koha-common.service - Start required services for each Koha instance
Loaded: loaded (/etc/init.d/koha-common; enabled; vendor preset: enabled)
Active: active (running) since Thu 2023-06-01 05:15:09 EEST; 14s ago
Created attachment 151927 [details] [review] Bug 33371: Add [Install] section to koha-common.service to test: 1/ install pkg, reboot, note service is not 'active' 2/ add patch, build package 3/ install pkg, reboot, note service is 'active' :) root@deb11:/etc# systemctl status koha-common * koha-common.service - Start required services for each Koha instance Loaded: loaded (/etc/init.d/koha-common; enabled; vendor preset: enabled) <<<< Active: active (exited) since Thu 2023-06-01 12:45:08 UTC; 13min ago Tasks: 0 (limit: 2244) Memory: 0B CPU: 0 CGroup: /system.slice/koha-common.service Jun 01 12:45:08 deb11 systemd[1]: Starting Start required services for each Koha instance... Created attachment 151929 [details] [review] [PATCH] Bug 33371: Add [Install] section to koha-common.service to test: 1/ install pkg, reboot, note service is not 'active' 2/ add patch, build package 3/ install pkg, reboot, note service is 'active' :) root@deb11:/etc# systemctl status koha-common * koha-common.service - Start required services for each Koha instance Loaded: loaded (/etc/init.d/koha-common; enabled; vendor preset: enabled) <<<< Active: active (exited) since Thu 2023-06-01 12:45:08 UTC; 13min ago Tasks: 0 (limit: 2244) Memory: 0B CPU: 0 CGroup: /system.slice/koha-common.service Jun 01 12:45:08 deb11 systemd[1]: Starting Start required services for each Koha instance... Signed-off-by: Andrew Nugged <nugged@gmail.com> Created attachment 151930 [details] [review] Bug 33371: Add [Install] section to koha-common.service to test: 1/ install pkg, reboot, note service is not 'active' 2/ add patch, build package 3/ install pkg, reboot, note service is 'active' :) root@deb11:/etc# systemctl status koha-common * koha-common.service - Start required services for each Koha instance Loaded: loaded (/etc/init.d/koha-common; enabled; vendor preset: enabled) <<<< Active: active (exited) since Thu 2023-06-01 12:45:08 UTC; 13min ago Tasks: 0 (limit: 2244) Memory: 0B CPU: 0 CGroup: /system.slice/koha-common.service Jun 01 12:45:08 deb11 systemd[1]: Starting Start required services for each Koha instance... Signed-off-by: Andrew Nugged <nugged@gmail.com> Pushed to master for 23.05. Nice work everyone, thanks! Nice work everyone! Pushed to stable for 22.11.x |