mattermost-developer-documentation icon indicating copy to clipboard operation
mattermost-developer-documentation copied to clipboard

Modified the 'Type=oneshot' to 'Type=simple' in the systemd service file

Open 1kjnv opened this issue 11 months ago • 8 comments

Summary

Modified the 'Type=oneshot' to 'Type=simple' in the systemd service file

When the process is started using 'systemctl start' or 'systemctl restart', the status remains stuck at

'activating'

because the oneshot type does not indicate to systemd that the process has started successfully.

Changing the type to simple ensures that systemd recognizes the process as running once it is launched.

1kjnv avatar May 29 '25 09:05 1kjnv

Hello @1kjnv,

Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

Per the Mattermost Contribution Guide, we need to add you to the list of approved contributors for the Mattermost project.

Please help complete the Mattermost contribution license agreement? Once you have signed the CLA, please comment with /check-cla and confirm that the CLA check is green.

This is a standard procedure for many open source projects.

Please let us know if you have any questions.

We are very happy to have you join our growing community! If you're not yet a member, please consider joining our Contributors community channel to meet other contributors and discuss new opportunities with the core team.

mattermost-build avatar May 29 '25 09:05 mattermost-build

/check-cla

1kjnv avatar May 29 '25 09:05 1kjnv

Newest code from 1kjnv has been published to preview environment for Git SHA d85ab97a5b582b9e6872129df7962a27a841bf8d

github-actions[bot] avatar May 29 '25 14:05 github-actions[bot]

I think we want to keep oneshot as we want to wait for the service to have actually started, the option "simple" does not wait even if there was a failure.

Here is a reference that describes the difference between them https://stackoverflow.com/a/39050387

enahum avatar May 30 '25 10:05 enahum

@enahum I'd like to change 'oneshot' to 'simple' for the following reasons:

  • mattermost-push-proxy is a long-running process that is meant to keep running
  • the system is stuck in the 'activating' state because systemd is expecting the process to exit cleanly(as it should with 'oneshot'), but it doesn't.
  • this can cause issues in automation workflows because 'oneshot' tells systemd to wait until the process exits before marking the service as 'started'. But, with 'oneshot', your service never exits so systemd will wait forever(or until timeout). And, CLI commands like systemctl restart or ansible, shell scripts, etc., that depend on systemctl completing will hang until timeout or manual interruption (CTRL+C)
  • it may also break automated restart and recovery flows

1kjnv avatar Jun 02 '25 04:06 1kjnv

@stylianosrigas any input on this?

enahum avatar Jun 02 '25 05:06 enahum

@enahum @stylianosrigas reminder!

1kjnv avatar Jun 09 '25 12:06 1kjnv

This PR has been automatically labelled "stale" because it hasn't had recent activity. A core team member will check in on the status of the PR to help with questions. Thank you for your contribution!

mattermost-build avatar Jun 27 '25 01:06 mattermost-build