question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

service onestart on FreeBSD has unintended side effects for some packages

See original GitHub issue

With the package samba41 installed, running “service samba_server onestart” results in nmbd, smbd and winbindd to be started, even if winbindd_enable=“NO” in rc.conf which causes “service samba_server start” to normally not start winbindd.

On FreeBSD the service.running state uses onestart to start the service, presumably so it can start the service even if it is not enabled.

I’m not sure what the best practice for this is to solve it in a general case, but for instances where the service is defined as:

samba:
  service.running:
    - enable: True

There is no need to run onestart as long as the ‘enable’ step is done before the start step.

Likewise using “service samba_server onestatus” will always return 1 because it will check foro nmbd, smbd and winbindd’s status even if winbindd is disabled. Using onestop however shouldn’t cause any issues.

Issue Analytics

  • State:open
  • Created 10 years ago
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
darkpixelcommented, Jan 24, 2020

Awesome! Thanks @sagetherage !

0reactions
nvxcommented, Aug 20, 2020

So note that there is already functionality to determine if a service is enabled - https://github.com/saltstack/salt/blob/0b2a5613b345f17339cb90e60b407199b3d26980/salt/modules/freebsdservice.py#L128

If the answer is yes, using start would fix this. If it’s not enabled then you’d have to fall back to onestart which has these side effects in some cases, but I imagine the most common case would be service.running with enable set to True so you’d be enabling it first if not already then starting the service.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why use the 'onestart' command as opposed to just 'start'?
The RC scripts are called with "start" as an argument at boot time, and when called as such the service is only started...
Read more >
Quare FreeBSD? - 𝚟𝚎𝚛𝚖𝚊𝚍𝚎𝚗 - WordPress.com
If some random FreeBSD package would add libc.so to /usr/local/lib dir then ... service jail onestart nextcloud Starting jails: nextcloud.
Read more >
OpenBSD rc.d(8) - BSDCan
rc.d(8) was developed to abstract service management while ... similar to “onestart” in FreeBSD and NetBSD); packages rc.d scripts usually ...
Read more >
FreeNAS® 11.3-RELEASE User Guide - iXsystems, Inc.
FreeBSD ® is a registered trademark of the FreeBSD Foundation ... support, web service discovery support, and improved directory listing performance for ...
Read more >
autoconf.txt - GNU.org
For each software package that Autoconf is used with, ... use the `set' command to process strings, and this has the side effect...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found