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

Detect Systemd presence for php-fpm on *nix systems #72

Closed
Pierstoval opened this issue Jan 25, 2021 · 1 comment
Closed

Detect Systemd presence for php-fpm on *nix systems #72

Pierstoval opened this issue Jan 25, 2021 · 1 comment

Comments

@Pierstoval
Copy link
Member

Pierstoval commented Jan 25, 2021

When running on Docker or some specific distros, we can have such output when starting the server:

web_1  |  2021-01-25T22:16:13.772Z  INFO > Starting PHP...
web_1  |  2021-01-25T22:16:13.814Z  INFO > Using php-fpm
web_1  |  2021-01-25T22:16:13.815Z  INFO > Running php-fpm with PID 10
web_1  | [25-Jan-2021 22:16:13] ERROR: [/root/.rymfony/fpm-conf.ini:12] unknown entry 'systemd_interval'
web_1  | [25-Jan-2021 22:16:13] ERROR: failed to load configuration file '/root/.rymfony/fpm-conf.ini'
web_1  | [25-Jan-2021 22:16:13] ERROR: FPM initialization failed
web_1  | thread 'main' panicked at 'PHP server exited with exit code: 78', src/php/php_server.rs:50:29
web_1  | note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The systemd_interval value should be dropped when running a system that isn't started with systemd.

Across some quick research, it seems that this command might help:

ps --no-headers -o comm 1

It either returns init or systemd, and might help detecting this.

There are other ways, such as running systemctl to see if it's available or not, or check if file /sbin/init shows a symbolic link or an executable.

I'm not sure which one should be used by Rymfony, but what I'm sure is that this should be a one-time system check, cached somewhere in Rymfony's global configuration.

@Pierstoval
Copy link
Member Author

Pierstoval commented Mar 24, 2021

Fixed in v0.1.1 (see changelog)

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

No branches or pull requests

1 participant