Parsing systemd service descriptions fails when (valid) single quote is in unit.description
See original GitHub issueDescribe the issue you are experiencing
I’m attempting to update supervisor from supervisor-2021.03.4 to supervisor-2021.03.6 and it’s throwing an error while trying to parse host system service information.
What is the used version of the Supervisor?
supervisor-2021.03.4
What type of installation are you running?
Home Assistant Supervised
Which operating system are you running on?
Debian
What is the version of your installed operating system?
Debian GNU/Linux 10 (buster)
What version of Home Assistant Core is installed?
core-2021.3.3
Steps to reproduce the issue
- Have the Splunk Forwarder installed on the host system, or have a ’ mark in a systemd service file in the description line (this is valid)
- Browse to Supervisor -> System tab
- Click update in the Supervisor block
- See error
Anything in the Supervisor logs that might be useful for us?
# Put your logs below this line
' - Expecting ',' delimiter: line 1 column 14455 (char 14454)
21-03-27 09:34:21 WARNING (MainThread) [supervisor.host.services] Can't update host service information
The line where it throws an error is this, at the misplaced quote just before splunk enable boot-start
:
["SplunkForwarder.service", "Systemd service file for Splunk, generated by "splunk enable boot-start"", "loaded", "active", "running", "", "/org/freedesktop/systemd1/unit/SplunkForwarder_2eservice", 0, "", "/"]
It’s erroring because 'splunk enable boot-start'
from the systemd unit file (which has single quotes) has been converted to double quotes at some point in Home Assistant’s handling of things.
The relevant part of the original systemd unit file:
$ cat /etc/systemd/system/SplunkForwarder.service
[Unit]
Description=Systemd service file for Splunk, generated by 'splunk enable boot-start'
After=network.target
[Service]
Type=simple
Restart=always
<snip>
SImilar output from the command line:
$ systemctl status SplunkForwarder.service
* SplunkForwarder.service - Systemd service file for Splunk, generated by 'splunk enable boot-start'
Loaded: loaded (/etc/systemd/system/SplunkForwarder.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2021-03-22 13:22:26 AEST; 5 days ago
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
systemctl - Freedesktop.org
Stop (deactivate) one or more units specified on the command line. This command will fail if the unit does not exist or if...
Read more >Bash won't recognize existence of closing single quote in ...
Bash won't recognize existence of closing single quote in systemd unit file - Stack Overflow. Stack Overflow for Teams – Start collaborating ...
Read more >How to use quote and dollarsign with systemd
So, the quoting rules: Enclose the string to be treated as a single argument either in single quotes (' ') or double quotes...
Read more >Understanding Systemd Units and Unit Files | DigitalOcean
Ideas that in other init systems may be handled with one unified service definition can be broken out into component units according to ......
Read more >Ubuntu Manpage: systemd.service - Service unit configuration
A unit configuration file whose name ends in .service encodes information about ... If one of the commands fails (and is not prefixed...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is still a problem with the latest version.
Hi there @yaleman 👋
Installing additional software on the host for supervised installations is not supported and this is not considered a bug with the supervisor.
https://github.com/home-assistant/architecture/blob/master/adr/0014-home-assistant-supervised.md
I suggest you; a) Remove it b) Manually adjust the service file