implement manage_service for BSDs

Bug #1990070 reported by Mina Galić
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Wishlist
Mina Galić

Bug Description

Distro.manage_services is currently only implemented for SystemD based Linux distros.
SysV based BSDs and OpenRC based Alpine are left out.

on BSDs, services are enabled in /etc/rc.conf (on FreeBSD, this can be done with sysrc(8) https://man.freebsd.org/sysrc(8), and started/stopped/restarted, etc… via service(8): https://man.freebsd.org/service(8) or rc.d(8): https://man.netbsd.org/rc.d.8

Mina Galić (minagalic)
summary: - implement manage_service for BSDs and Alpine
+ implement manage_service for BSDs
description: updated
Revision history for this message
Mina Galić (minagalic) wrote :

FreeBSD's service implements enable, disable and enabled.
They are not documented in the man page.

Nothing needs to be done here.

NetBSD has a service command: https://man.netbsd.org/service.8
that doesn't implement enable/enabled and disable.
Not just according to the man page.
It also doesn't have a sysrc wrapper for editing rc.conf
We can use bsd utils rc.conf update function to enable/disable services.

OpenBSD has no service wrapper, and no sysrc wrapper
We can also use bsd utils rc.conf update function here to enable/disable services.
Its /etc/rc.d/<service> also don't seem to have a status command, however, stop and start are idempotent, so you can use those to, if you know what you're expecting

James Falcon (falcojr)
Changed in cloud-init:
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
Mina Galić (minagalic) wrote :

Actually, OpenBSD has rcctl, which makes this all quite easy: https://github.com/canonical/cloud-init/pull/1758

Changed in cloud-init:
status: Triaged → In Progress
assignee: nobody → Mina Galić (minagalic)
Revision history for this message
Alberto Contreras (aciba) wrote :
James Falcon (falcojr)
Changed in cloud-init:
status: In Progress → Fix Committed
Revision history for this message
James Falcon (falcojr) wrote : Fixed in cloud-init version 22.4.

This bug is believed to be fixed in cloud-init in version 22.4. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.