Bug 1278475 - Problem with empty parameter in unit file
Problem with empty parameter in unit file
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
23
Unspecified Linux
unspecified Severity high
: ---
: ---
Assigned To: systemd-maint
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-05 10:00 EST by Joachim Jaeckel
Modified: 2015-12-17 02:24 EST (History)
7 users (show)

See Also:
Fixed In Version: systemd-222-10.fc23
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-17 02:24:14 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
/etc/systemd/system/test-unit.service (190 bytes, text/plain)
2015-11-05 10:00 EST, Joachim Jaeckel
no flags Details
/tmp/test-unit.sh (101 bytes, application/x-shellscript)
2015-11-05 10:01 EST, Joachim Jaeckel
no flags Details

  None (edit)
Description Joachim Jaeckel 2015-11-05 10:00:39 EST
Created attachment 1090138 [details]
/etc/systemd/system/test-unit.service

Description of problem:

ExecStart=/tmp/test-unit.sh 1 2 3 '' 5 6 7

Empty parameter is not passed to test-unit.sh
Parameters following to the empty parameter are not passed.


Version-Release number of selected component (if applicable):
systemd-222-8.fc23.x86_64

How reproducible:
always

Steps to Reproduce:
1. Create a Testservice:
File /etc/systemd/system/test-unit.service
[Unit]
Description=test
DefaultDependencies=no
[Service]
PrivateTmp=false
Type=oneshot
RemainAfterExit=yes
ExecStart=/tmp/test-unit.sh 1 2 '3' '' 5 6 7
[Install]
WantedBy=multi-user.target

File /tmp/test-unit.sh
#! /bin/bash
echo $0 $@
echo P1=$1
echo P2=$2
echo P3=$3
echo P4=$4
echo P5=$5
echo P6=$6
echo P7=$7

2. Prepare
chmod +x /tmp/test-unit.sh
systemctl daemon-reload

3. Start
systemctl start test-unit.service
systemctl status test-unit.service -l


Actual results:
[root@vega ~]# systemctl status test-unit.service -l
* test-unit.service
   Loaded: loaded (/etc/systemd/system/test-unit.service; disabled; vendor preset: disabled)
   Active: active (exited) since Thu 2015-11-05 15:49:20 CET; 5s ago
  Process: 4022 ExecStart=/tmp/test-unit.sh 1 2 3 (code=exited, status=0/SUCCESS)
 Main PID: 4022 (code=exited, status=0/SUCCESS)

Nov 05 15:49:20 vega.jj systemd[1]: Starting test-unit.service...
Nov 05 15:49:20 vega.jj test-unit.sh[4022]: /tmp/test-unit.sh 1 2 3
Nov 05 15:49:20 vega.jj test-unit.sh[4022]: P1=1
Nov 05 15:49:20 vega.jj test-unit.sh[4022]: P2=2
Nov 05 15:49:20 vega.jj test-unit.sh[4022]: P3=3
Nov 05 15:49:20 vega.jj test-unit.sh[4022]: P4=
Nov 05 15:49:20 vega.jj test-unit.sh[4022]: P5=
Nov 05 15:49:20 vega.jj test-unit.sh[4022]: P6=
Nov 05 15:49:20 vega.jj test-unit.sh[4022]: P7=
Nov 05 15:49:20 vega.jj systemd[1]: Started test-unit.service.


Expected results:
/tmp/test-unit.sh 1 2 3 5 6 7
P1=1
P2=2
P3=3
P4=
P5=5
P6=6
P7=7



Additional info:
was working in F22: systemd-219-25.fc22.x86_64
Comment 1 Joachim Jaeckel 2015-11-05 10:01 EST
Created attachment 1090139 [details]
/tmp/test-unit.sh
Comment 3 Fedora Update System 2015-12-14 06:17:40 EST
systemd-222-9.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-76fc543765
Comment 4 Fedora Update System 2015-12-14 07:29:03 EST
systemd-222-10.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-76fc543765
Comment 5 Fedora Update System 2015-12-15 05:54:02 EST
systemd-222-10.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update systemd'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-76fc543765
Comment 6 Fedora Update System 2015-12-17 02:23:15 EST
systemd-222-10.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.