Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • L lpadmincern
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Jira
    • Jira
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • linuxsupportlinuxsupport
  • rpmsrpms
  • lpadmincern
  • Merge requests
  • !7

Respect spaces in ARGS passed to systemd unit

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Steve Traylen requested to merge straylen/lpadmincern:envs into master May 19, 2022
  • Overview 0
  • Commits 1
  • Pipelines 1
  • Changes 1

Currently with a drop file setting of say

Environment=ARGS="--add *"

this calls lpadmincern '--add *'

Previously with the perl version this was accepted but in fact lpadmincern did nothing.

With the python version this quite correctly gives a parameter validation error.

From man systemd.service

Basic environment variable substitution is supported. Use "${FOO}" as part of a word, or as a word of its own, on the command line, in which case it will be replaced by the value of the environment variable including all whitespace it contains, resulting in a single argument. Use "$FOO" as a separate word on the command line, in which case it will be replaced by the value of the environment variable split at whitespace, resulting in zero or more arguments. For this type of expansion, quotes are respected when splitting into words, and afterwards removed.

It was worth coming to work today.

Edited May 19, 2022 by Steve Traylen
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: envs