The component os_signals::ProcessorComponent stores os_signals::Processor and listens to SIGUSR1 and SIGUSR2 signals. You can use AddListener function to subscribe to these signals.
For example, we use signal SIGUSR1 in components::Logging for reopening files after executing logrotate.
In the component constructor, pass context.Scopes() to os_signals::Processor::AddListener. The component's scopes register the listener after construction and unsubscribe it before destruction. For example, components::Logging registers its log rotation handler here: