Description of problem: We are trying to create service file for smartd for which some configuration is present in /etc/sysconfig/smartmontools : smartd_opts="-q never" however systemd does not handle it correctly: ExecStart=/usr/sbin/smartd -n $smartd_opts is always interpreted as: argv[1]=-n argv[2]=-q never instead of expected: argv[1]=-n argv[2]=-q argv[3]=never man page contains: Also $FOO may appear as separate word on the command line in which case the variable is replaced by its value split at whitespaces. but it behaves differently Version-Release number of selected component (if applicable): systemd-15-1.fc15.x86_64 How reproducible: always Steps to Reproduce: 1) /lib/systemd/system/smartd.service: """""""""""""" [Unit] Description=Self Monitoring and Reporting Technology (SMART) Daemon After=syslog.target [Service] EnvironmentFile=/etc/sysconfig/smartmontools ExecStart=/usr/sbin/smartd.sh -n $smartd_opts [Install] WantedBy=multi-user.target """"""""""""" 2) /usr/sbin/smartd.sh """"""""""""" #!/bin/bash sleep 3600 """"""""""""" 3) chmod +x /usr/sbin/smartd.sh 4) systemctl --system daemon-reload 5) systemctl start smartd.service 6) get pid from systemctl status smartd.service 7) check /proc/<pid>/cmdline Actual results: no '\0' between "-q" and "never" cat /proc/<pid>/cmdline shows /bin/bash/usr/sbin/smartde-n-q never because there is ' ' instead of '\0' Expected results: '\0' between "-q" and "never" cat /proc/<pid>/cmdline would show /bin/bash/usr/sbin/smartde-n-qnever additional comments: I don't know why ${smartd_opts} should behave differently than $smartd_opts, because it's misleading. These variables looks like shell variables and from shell's pov both are interpreted the same way. Anyway, ${var} does not work too, because $var is interpreted as "-q never" and ${var} as "\"-q never\"" if ${smartd_opts} is used instead of $smartd_opts
Michal, why is this not a duplicate of bug 661291?
*** This bug has been marked as a duplicate of bug 661291 ***