Sunil Mohan Adapa 7c14677277
service: Notify systemd when service starts up
- Run as a Type=notify service with systemd service.

- Notify systemd just before blocking in the main thread.

- This allows systemd to catch any errors with startup of the service and log
appropriately. This also allows clients depending on making DBus calls etc. to
know that service is ready to serve requests.

- This will increase the boot time slightly as systemd will wait until
FreedomBox service to become active.

Tests:

- Raise an exception in main() during startup. Run 'systemctl start plinth'. No
error is thrown without this patch. With the patch, an error is shown.

- After 'systemctl start plinth', service shows in 'active' state.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2025-04-05 10:20:59 -04:00
..