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

[💡 FEATURE REQUEST]: Make a universal configuration for running commands for all plugins #1584

Closed
Kaspiman opened this issue May 27, 2023 · 4 comments
Assignees
Labels
C-feature-request Category: feature requested, but need to be discussed
Milestone

Comments

@Kaspiman
Copy link

Kaspiman commented May 27, 2023

Plugin

Server

I have an idea!

Feature is a very similar to this #1570

on_init contained in server section but doesn't inherit user/group parameters. I want to specify these parameters explicitly.

server:
    command: "php public/index.php"
    user: www-data
    group: www-data
    on_init:
        command: "bin/console command:whoami" # echo whoami = root
        # user: www-data
        # group: www-data

In general, a more thorough improvement of the commands can be suggested. Now "command" is the simple path to the file, but it's worth turning this path into a more universal structure.

Like this:

server:
    command:
        path: "php public/index.php"
        user: "www-data"
        group: "www-data"
        another_param: "another_value"
    on_init:
        command:
            path: "bin/console command:whoami" # echo root
            another_param: "another_value"

service:
    schedule:run:
        command:
            path: "bin/console schedule:run"
            user: "www-data"
            group: "www-data"
            another_param: "another_value"
        process_num: 1
        exec_timeout: 0s
        remain_after_exit: true
        service_name_in_log: false
        restart_sec: 60

Now it is clear that there can be commands in different plugins and it is worth making a general configuration method. Thanks to this, it is not necessary to add a user and group setting to each plugin.

@Kaspiman Kaspiman added the C-feature-request Category: feature requested, but need to be discussed label May 27, 2023
@Kaspiman Kaspiman changed the title [💡 FEATURE REQUEST]: Add the ability to configure the user and group for on_init and after_init phases [💡 FEATURE REQUEST]: Make a universal configuration for running commands for all plugins May 27, 2023
@github-project-automation github-project-automation bot moved this to Backlog in General May 29, 2023
@rustatian rustatian added this to the v2024.1.0 milestone May 29, 2023
@rustatian rustatian moved this from Backlog to Discuss in General May 29, 2023
@rustatian
Copy link
Member

Hey @Kaspiman 👋🏻
This is not possible at the moment, as it would break config v3. Counfig should be stable between major releases. But since I like the idea, I'll put it in the Discuss column for 2024.1.0.
Thanks 👍🏻

@Kaspiman
Copy link
Author

Hi! Maybe for now we should add user/group for on_init only?

@rustatian
Copy link
Member

I don't think, that we need to add the user and group per every pool. All pools configuration (user and group) is located under the server plugin. I don't think, that we should duplicate these options all around the every command.

@rustatian
Copy link
Member

Thanks @Kaspiman, I thought of this suggestion:

        command:
            path: "bin/console schedule:run"
            user: "www-data"
            group: "www-data"
            another_param: "another_value"

Command nowaday is quite universal. I don't think that splitting command itself from it's args simplifies the use of the command. It'll also break all configs, plus it would be harder to just copy-paste the command into the RR command field.

@github-project-automation github-project-automation bot moved this from Discuss to Unreleased in General May 29, 2023
@rustatian rustatian moved this from Unreleased to Done in General Jun 8, 2023
@rustatian rustatian moved this to ✅ Done in Jira 😄 Oct 12, 2023
@rustatian rustatian modified the milestones: v2024.1.0, v2024 Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: feature requested, but need to be discussed
Projects
Status: ✅ Done
Status: Done
Development

No branches or pull requests

2 participants