saltstack / saltstack/salt

[BUG] Windows: ps.psaux requires a "ps" command to work

Open
#65,252 1 comment 0 reactions 1 assignee View on GitHub

@twangboy is already working on this.

Since Sep 21, 2023.

bug Execution-Module Windows
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
The execution function ps.psaux requires the ps command to work which is non-standard on Windows

Setup

Standard Windows install using .exe installer

  • 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

PS C:\Users\User> salt-call ps.psaux Python
Error running 'ps.psaux': Unable to run command 'ps aux'
with the context '{'cwd': 'C:\\Users\\User', 'shell': False,
'env': {'ALLUSERSPROFILE': 'C:\\ProgramData', 'APPDATA':
'C:\\Users\\User\\AppData\\Roaming', 'CommonProgramFiles':
'C:\\Program Files\\Common Files',
'CommonProgramFiles(Arm)': 'C:\\Program Files (Arm)\\Common
Files', 'CommonProgramFiles(x86)': 'C:\\Program Files
(x86)\\Common Files', 'CommonProgramW6432': 'C:\\Program
Files\\Common Files', 'COMPUTERNAME': 'WINDOWS-K3E3JQ8',
'ComSpec': 'C:\\Windows\\system32\\cmd.exe', 'DriverData':
'C:\\Windows\\System32\\Drivers\\DriverData', 'EFC_5008':
'0', 'FPS_BROWSER_APP_PROFILE_STRING': 'Internet Explorer',
'FPS_BROWSER_USER_PROFILE_STRING': 'Default', 'HOMEDRIVE':
'C:', 'HOMEPATH': '\\Users\\User', 'LOCALAPPDATA':
'C:\\Users\\User\\AppData\\Local', 'LOGONSERVER':
'\\\\WINDOWS-K3E3JQ8', 'NUMBER_OF_PROCESSORS': '2',
'OneDrive': 'C:\\Users\\User\\OneDrive', 'OS': 'Windows_NT',
'Path':
'C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program
Files\\Salt
Project\\Salt;C:\\Users\\User\\AppData\\Local\\Microsoft\\WindowsApps;',
'PATHEXT':
'.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL',
'PROCESSOR_ARCHITECTURE': 'AMD64', 'PROCESSOR_IDENTIFIER':
'ARMv8 (64-bit) Family 8 Model 0 Revision   0, QEMU',
'PROCESSOR_LEVEL': '0', 'PROCESSOR_REVISION': '0000',
'ProgramData': 'C:\\ProgramData', 'ProgramFiles':
'C:\\Program Files', 'ProgramFiles(Arm)': 'C:\\Program Files
(Arm)', 'ProgramFiles(x86)': 'C:\\Program Files (x86)',
'ProgramW6432': 'C:\\Program Files', 'PSModulePath':
'C:\\Users\\User\\Documents\\WindowsPowerShell\\Modules;C:\\Program
Files\\WindowsPowerShell\\Modules;C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules',
'PUBLIC': 'C:\\Users\\Public', 'SESSIONNAME': 'Console',
'SystemDrive': 'C:', 'SystemRoot': 'C:\\Windows', 'TEMP':
'C:\\Users\\User\\AppData\\Local\\Temp', 'TMP':
'C:\\Users\\User\\AppData\\Local\\Temp', 'USERDOMAIN':
'WINDOWS-K3E3JQ8', 'USERDOMAIN_ROAMINGPROFILE':
'WINDOWS-K3E3JQ8', 'USERNAME': 'User', 'USERPROFILE':
'C:\\Users\\User', 'windir': 'C:\\Windows'}, 'stdin': None,
'stdout': -1, 'stderr': -2, 'with_communicate': True,
'timeout': None, 'bg': False}', reason: [WinError 2] The
system cannot find the file specified

Expected behavior

Either for the function to work as expected, or the documentation to make clear that it doesn't work on Windows.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3006.3

Python Version:
        Python: 3.10.13 (heads/main:7ee24e6, Sep  6 2023, 02:19:49) [MSC v.1936 64 bit (AMD64)]

Dependency Versions:
          cffi: 1.14.6
      cherrypy: 18.6.1
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: 4.0.7
     gitpython: Not Installed
        Jinja2: 3.1.2
       libgit2: Not Installed
  looseversion: 1.0.2
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 22.0
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.10.1
        pygit2: Not Installed
  python-gnupg: 0.4.8
        PyYAML: 6.0.1
         PyZMQ: 25.0.2
        relenv: 0.13.10
         smmap: 4.0.0
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist:
        locale: cp1252
       machine: AMD64
       release: 10
        system: Windows
       version: 10 10.0.22621 SP0 Multiprocessor Free

Additional context
Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.