Skip to content

Debian12 changes #162

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions cookbooks/supervisor/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,34 @@
# limitations under the License.
#


# foodcritic FC023: we prefer not having the resource on non-smartos
if platform_family?('smartos')
package 'py27-expat' do
action :install
end
end

execute 'pip install supervisor' do
command 'pip install supervisor --index=https://pypi.python.org/simple/'
# In Debian 12+, pip cannot install packages system-wide due to PEP 668
if platform?('debian') && node['platform_version'].to_i >= 12
# Install pipx for isolated Python package installation
package 'pipx'

# Ensure pipx is in PATH
execute 'pipx ensurepath' do
command 'pipx ensurepath'
not_if 'grep -q "PATH.*\.local/bin" /etc/environment'
end

# Install supervisor using pipx
execute 'install supervisor with pipx' do
command 'pipx install supervisor --index=https://pypi.python.org/simple/'
not_if 'pipx list | grep -q supervisor'
end
else
# For older Debian versions or other platforms, install directly with pip
execute 'pip install supervisor' do
command 'pip install supervisor --index=https://pypi.python.org/simple/'
end
end

directory node['supervisor']['dir'] do
Expand All @@ -49,8 +67,8 @@
supervisord_minfds: node['supervisor']['minfds'],
supervisord_minprocs: node['supervisor']['minprocs'],
supervisor_version: node['supervisor']['version'],
socket_file: node['supervisor']['socket_file']
}
socket_file: node['supervisor']['socket_file'],
}
end)
end

Expand Down
Loading