duck.cli.commands.serviceยถ
Module containing commands for creating and managing Duck services using systemd (compatible with linux-based systems only).
Module Contentsยถ
Classesยถ
Dataยถ
APIยถ
- duck.cli.commands.service.SERVICE_CONTENT = <Multiline-String>ยถ
- class duck.cli.commands.service.ServiceCommand[source]ยถ
- classmethod autorun(kill: bool = False, enable: bool = False, disable: bool = False, settings: str = None, show_status: bool = True)[source]ยถ
This automatically creates and runs the Duck service at latest changes, you do not need to reload systemd, everything will be done for you.
The status of the service will be printed after if the other steps completed successfully.
- Parameters:
kill โ Whether to kill a running Duck service (if present) before running this new latest service.
enable โ Enables the new service to be started on boot.
disable โ Disables the new service not to be started on boot.
settings โ Customizable comma-separated Duck settings you want to change at runtime without depending on settings.py. Example:
key=value, key2=value2status โ Whether to show status of the service if other steps completed.
- classmethod check_service()[source]ยถ
Method to check the status of the systemd service and display detailed information.
- classmethod create_service(settings: str = None)[source]ยถ
Function to create the systemd service for Duck.
- Parameters:
settings โ Customizable comma-separated Duck settings you want to change at runtime without depending on settings.py. Example:
key=value, key2=value2
Notes:
The settings argument can only be useful for string value type settings.
Example Usage:
duck service create --settings "systemd_exec_command=duck runserver -p 5000, systemd_restart=always"