Skip to content

Conversation

Stebalien
Copy link
Contributor

Oneshot systemd services transition directly from activating to dead/inactive and never show up as "active". This change treats these services as "active" when "activating" because that's likely what the user wants. Otherwise, backup tasks, etc. never show up as active services in i3status-rs.

Oneshot systemd services transition directly from activating to
dead/inactive and never show up as "active". This change treats these
services as "active" when "activating" because that's likely what the
user wants. Otherwise, backup tasks, etc. never show up as active
services in i3status-rs.
Comment on lines +178 to +182
let service_type = self
.service_proxy
.type_()
.await
.error("Could not get service type")?;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read this property every time in case the underlying service changes.

@Stebalien
Copy link
Contributor Author

From the systemd.service man page (do you don't have to go looking for it):

Behavior of oneshot is similar to simple; however, the service
manager will consider the unit up after the main process exits.
It will then start follow-up units. RemainAfterExit= is
particularly useful for this type of service. Type=oneshot is
the implied default if neither Type= nor ExecStart= are
specified. Note that if this option is used without
RemainAfterExit= the service will never enter "active" unit
state, but will directly transition from "activating" to
"deactivating" or "dead", since no process is configured that
shall run continuously. In particular this means that after a
service of this type ran (and which has RemainAfterExit= not
set) it will not show up as started afterwards, but as dead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant