Bug 1278475

Summary: Problem with empty parameter in unit file
Product: [Fedora] Fedora Reporter: Joachim Jaeckel <bugzilla-2004>
Component: systemdAssignee: systemd-maint
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 23CC: johannbg, jsynacek, lnykryn, msekleta, s, systemd-maint, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: systemd-222-10.fc23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-17 07:24:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
/etc/systemd/system/test-unit.service
none
/tmp/test-unit.sh none

Description Joachim Jaeckel 2015-11-05 15:00:39 UTC
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 15:01:44 UTC
Created attachment 1090139 [details]
/tmp/test-unit.sh

Comment 3 Fedora Update System 2015-12-14 11:17:40 UTC
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 12:29:03 UTC
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 10:54:02 UTC
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 07:23:15 UTC
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.