Skip to content

[BUG] systemd_service.* functions hard code relative command name #62942

Closed
@nicholasmhughes

Description

Description
Functions in the systemd_service execution module have hard-coded command names which rely on the PATH environment variable to be properly set in order to run correctly.

Steps to Reproduce the behavior
On a Debian 10 system, the PATH variable was modified to remove locations where the systemctl and runlevel commands would be found:

# /root/.bashrc
export PATH=""

Then, any calls to will fail.

Expected behavior
It would be nice if the functions made an effort to locate the full path to the binaries.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3005+0na.c57a277
 
Dependency Versions:
          cffi: Not Installed
      cherrypy: Not Installed
      dateutil: Not Installed
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.2
       libgit2: Not Installed
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.4
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: Not Installed
      pycrypto: 2.6.1
  pycryptodome: 3.15.0
        pygit2: Not Installed
        Python: 3.7.3 (default, Jan 22 2021, 20:04:44)
  python-gnupg: Not Installed
        PyYAML: 6.0
         PyZMQ: 23.2.1
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.4
 
System Versions:
          dist: debian 10 buster
        locale: UTF-8
       machine: x86_64
       release: 4.19.0-21-amd64
        system: Linux
       version: Debian GNU/Linux 10 buster

Metadata

Assignees

No one assigned

    Labels

    Bugbroken, incorrect, or confusing behaviorExecution-Module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions