You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
If py-setproctitle is installed, then commands like service salt_minion status or service salt_minion stop won't work on FreeBSD.
Setup
The bug affects any Salt minion running on FreeBSD, if the py-setproctitle package is also installed. It probably affects the salt master too, though I haven't tested.
on-prem machine
VM (Virtualbox, KVM, etc. please specify)
VM running on a cloud service, please be explicit and add details
container (Kubernetes, Docker, containerd, etc. please specify)
or a combination, please be explicit
jails if it is FreeBSD
classic packaging
onedir packaging
used bootstrap to install
Steps to Reproduce the behavior
Install and configure the minion using the FreeBSD package: sysutils/py-salt .
Start the minion with service salt_minion start
Attempt to query its status with service salt_minion status. It will wrongly fail and report salt_minion is not running. even though the minion really is running.
Expected behavior
Should see something like this:
salt_minion is running as pid 64436
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Python Version:
Python: 3.11.11 (main, Jan 16 2025, 13:52:49) [Clang 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1aDependency Versions:
cffi: 1.17.1cherrypy: Not Installedcryptography: 42.0.8dateutil: 2.9.0docker-py: Not Installedgitdb: Not Installedgitpython: Not InstalledJinja2: 3.1.4libgit2: Not Installedlooseversion: 1.3.0M2Crypto: Not InstalledMako: Not Installedmsgpack: 1.1.0msgpack-pure: Not Installedmysql-python: Not Installedpackaging: 24.2pycparser: 2.22pycrypto: Not Installedpycryptodome: 3.21.0pygit2: Not Installedpython-gnupg: Not InstalledPyYAML: 6.0.1PyZMQ: 25.0.2relenv: Not Installedsmmap: Not Installedtimelib: Not InstalledTornado: 4.5.3ZMQ: 4.3.5System Versions:
dist: freebsd 14.2 locale: utf-8machine: amd64release: 14.2-AXCIENT1-p1system: FreeBSDversion: FreeBSD 14.2
Additional context
FreeBSD's service command relies on knowing both a daemon's PID and its process name in order to identify the running daemon. That means the daemon must have a predictable process name. But the salt minion's process name can change, depending on whether py-setproctitle is installed or not. And there are really multiple problems here:
The process title is unpredictable. It either be /usr/local/bin/python3.11 /usr/local/bin/salt-minion -c /usr/local/etc/salt --pid-file=/var/run/salt-minion.pid -d or python3.11: MultiMinionProcessManager MinionProcessManager (python3.11).
FreeBSD's service command expects the process title to be the name of a file, with an optional interpreter. But MultiMinionProcessManager isn't a file. So service will print out an annoying warning like /usr/local/etc/rc.d/salt_minion: WARNING: cannot read shebang line from MultiMinionProcessManager, even when I patch Salt to fix the other problems.
Possible Solutions
I see three possible solutions:
Simply disable setting the process title. It's unnecessary, IMHO.
Make py-setproctitle into a mandatory dependency and fix the problem of too many spaces.
On FreeBSD only, don't use -d and run the process supervised by daemon(8). That would work, but it's an awfully heavyweight solution.
My main question is, why does Salt need to change its process title? Is that really necessary?
Description
If py-setproctitle is installed, then commands like
service salt_minion status
orservice salt_minion stop
won't work on FreeBSD.Setup
The bug affects any Salt minion running on FreeBSD, if the py-setproctitle package is also installed. It probably affects the salt master too, though I haven't tested.
Steps to Reproduce the behavior
service salt_minion start
service salt_minion status
. It will wrongly fail and reportsalt_minion is not running.
even though the minion really is running.Expected behavior
Should see something like this:
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)Additional context
FreeBSD's
service
command relies on knowing both a daemon's PID and its process name in order to identify the running daemon. That means the daemon must have a predictable process name. But the salt minion's process name can change, depending on whether py-setproctitle is installed or not. And there are really multiple problems here:/usr/local/bin/python3.11 /usr/local/bin/salt-minion -c /usr/local/etc/salt --pid-file=/var/run/salt-minion.pid -d
orpython3.11: MultiMinionProcessManager MinionProcessManager (python3.11)
.service
command expects the process title to be the name of a file, with an optional interpreter. ButMultiMinionProcessManager
isn't a file. Soservice
will print out an annoying warning like/usr/local/etc/rc.d/salt_minion: WARNING: cannot read shebang line from MultiMinionProcessManager
, even when I patch Salt to fix the other problems.Possible Solutions
I see three possible solutions:
-d
and run the process supervised by daemon(8). That would work, but it's an awfully heavyweight solution.My main question is, why does Salt need to change its process title? Is that really necessary?
Downstream Link
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=285053
The text was updated successfully, but these errors were encountered: