unit icon indicating copy to clipboard operation
unit copied to clipboard

CLI: New subcommand for restarting applications

Open javorszky opened this issue 9 months ago • 0 comments

A new subcommand unitctl app restart <name> to restart the application.

Given the following unit config:

{
    "applications": {
        "hello-world": {
            "type": "php",
            "root": "/www/hw/public/",
            "script": "index.php",
            "environment": {
                "PHP_INI_SCAN_DIR": ":/tmp/php.inis/"
            }
        },
        "other-one": {
            "type": "php",
            "root": "/www/oo/public/",
            "script": "index.php",
            "environment": {
                "PHP_INI_SCAN_DIR": ":/tmp/php.inis/"
            }
        }
    }
}

<name> would either be hello-world or other-one. Everything else should return an error.

It would call this endpoint to restart the application in question: https://unit.nginx.org/configuration/#process-management

javorszky avatar May 20 '24 21:05 javorszky