Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't run otobo_cron_1 as root #417

Closed
bschmalhofer opened this issue Sep 5, 2020 · 9 comments
Closed

Don't run otobo_cron_1 as root #417

bschmalhofer opened this issue Sep 5, 2020 · 9 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@bschmalhofer
Copy link
Contributor

Higher priority is to avoid running docker containers as root. This is already the case for otobo_web_1, but should also be the case for otobo_cron_1. The most simple ide a is to get rid of cron and call in entrypoint.sh something like

watch -n 300 $HOME/bin/otobo.Daemon.pl start

Originally posted by @bschmalhofer in https://github.com/RotherOSS/otobo/issues/280#issuecomment-687583015

bschmalhofer added a commit to RotherOSS/otobo-docker that referenced this issue Sep 5, 2020
bschmalhofer added a commit that referenced this issue Sep 5, 2020
namespace::autoclean
bschmalhofer added a commit that referenced this issue Sep 5, 2020
Instead run bin/otobo.Daemon.pl in a loop
bschmalhofer added a commit to RotherOSS/otobo-docker that referenced this issue Sep 5, 2020
@bschmalhofer
Copy link
Contributor Author

cron is gone now. Tests look fine. Closing the issue.

@bschmalhofer
Copy link
Contributor Author

Reopening as the setup can be simplified by using the restart: on-failure setting. See https://docs.docker.com/compose/compose-file/#restart .

@bschmalhofer bschmalhofer reopened this Sep 5, 2020
@bschmalhofer
Copy link
Contributor Author

bschmalhofer commented Sep 6, 2020

It's complicated. The OTOBO Daemon can't easily be run as a foreground process as bin/otobo.Daemon.pl makes an effort to run the actual Daemon as a forked process. So we stick with entrypoint.sh acting as a watchdog for the Daemon. Which is fine, as it prohibits the frequent retries that would be done by docker-compose.

While investigating this it was found the the Daemon does not shut down gracefully when the otobo_daemon_1 container is stopped. This behavior has been improved by adding a handler of SIGTERM to entrypoint.sh.

See also https://www.kaggle.com/residentmario/best-practices-for-propagating-signals-on-docker

bschmalhofer added a commit that referenced this issue Sep 6, 2020
Also 'use feature qw(say)'
@bschmalhofer
Copy link
Contributor Author

Tests look fine. The Github action has problems, but that looks unrelated. Closing the issue.

@bschmalhofer bschmalhofer self-assigned this Sep 18, 2020
@bschmalhofer bschmalhofer added the enhancement New feature or request label Sep 18, 2020
@bschmalhofer bschmalhofer added this to the OTOBO 10.0.4 milestone Sep 18, 2020
@bschmalhofer
Copy link
Contributor Author

Reopening as the feature should be backported to OTOBO 10.0.4

@bschmalhofer bschmalhofer reopened this Sep 18, 2020
@bschmalhofer
Copy link
Contributor Author

The feature will be backported in 10.0.4. The backport includes a renaming of the container from otobo_cron_1 to otobo_daemon_1. Do the renaming already for 10.0.3, in order to have as few conflicts as possible.

bschmalhofer added a commit that referenced this issue Sep 22, 2020
Issue #417: rename otobo_cron_1 to otobo_daemon_1
bschmalhofer added a commit to RotherOSS/otobo-docker that referenced this issue Sep 22, 2020
Even though the command 'cron' is still running in the container.
bschmalhofer added a commit to RotherOSS/otobo-docker that referenced this issue Sep 22, 2020
…e_cron_to_daemon

Issue RotherOSS/otobo#417: rename service 'cron' to 'daemon'
bschmalhofer added a commit to RotherOSS/doc-otobo-installation that referenced this issue Sep 22, 2020
bschmalhofer added a commit to RotherOSS/doc-otobo-installation that referenced this issue Sep 22, 2020
…e_cron_to_daemon

Issue RotherOSS/otobo#417: rename service cron to daemon
@bschmalhofer
Copy link
Contributor Author

Renaming from otobo_cron_1 to otobo_daemon_1 has been done.

bschmalhofer added a commit that referenced this issue Sep 25, 2020
Issue #417: grab Docker related changes from the rel-10_2 branch
bschmalhofer added a commit that referenced this issue Sep 25, 2020
Issue #417: some useful changes from the rel-10_0 branch
@bschmalhofer
Copy link
Contributor Author

Backporting from 10.1.x to 10.0.x has been done.

bschmalhofer added a commit to RotherOSS/otobo-docker that referenced this issue Sep 25, 2020
bschmalhofer added a commit to RotherOSS/otobo-docker that referenced this issue Sep 25, 2020
@bschmalhofer
Copy link
Contributor Author

No problems encountered.Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant