Skip to content

Conversation

@mdaneri
Copy link
Contributor

@mdaneri mdaneri commented Oct 16, 2024

Description

This pull request introduces a new feature to the Pode framework: built-in cross-platform service management. With this update, users can now easily register, start, stop, suspend, resume, query, restart, and unregister Pode-based services on Windows, Linux, and macOS.

Key Features

  • New Service Functions:

    • Register-PodeService: Register a Pode-based service with customizable options such as username, startup type, logging, and more.
    • Start-PodeService: Start a registered service.
    • Stop-PodeService: Stop a running service.
    • Suspend-PodeService: Suspend a service (Windows only).
    • Resume-PodeService: Resume a suspended service (Windows only).
    • Restart-PodeService: Restart a service.
    • Get-PodeService: Query the status of a service, including Running, Stopped, or Paused.
    • Unregister-PodeService: Unregister a service with optional forceful stopping.
  • Cross-Platform Compatibility:

    • Windows: Uses Windows Service Manager and supports additional options like SecurityDescriptorSddl.
    • Linux: Manages services via systemd, with support for custom user creation.
    • macOS: Leverages launchctl for service management.

Examples

Register and Start a Service

Register-PodeService -Name "HelloService" -Description "Example Pode Service" -ParameterString "-Verbose" -Start

Stop a Service

Stop-PodeService -Name "HelloService"

Query a Service

Get-PodeService -Name "HelloService"

Documentation

The pull request includes comprehensive documentation covering:

  • Usage of all service-related functions with examples.

Bug Fixes

  • Addressed potential issues with missing service configuration files during unregistration.
  • Improved error handling and verbose logging across all service functions.

Notes

  • Users should ensure they have administrative/root privileges when using these functions.

@mdaneri mdaneri changed the title Pode as windows and linux service (work in progress) Pode as windows and linux service (ready) Oct 22, 2024
@mdaneri mdaneri changed the title Pode as windows and linux service (ready) Pode as windows and linux service (ready for testing) Oct 22, 2024
@mdaneri mdaneri marked this pull request as draft October 22, 2024 01:48
@mdaneri mdaneri changed the title Pode as windows and linux service (ready for testing) Pode as windows, Mac and linux service (ready for testing) Oct 22, 2024
@Badgerati Badgerati added priority: high Target for next release or soon after. A priority but not critical story-points: 8 High complexity. Large features, deep refactors, or security work. Requires extensive review/testing labels Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: high Target for next release or soon after. A priority but not critical story-points: 8 High complexity. Large features, deep refactors, or security work. Requires extensive review/testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants