Ylianst / MeshCentral

A complete web-based remote monitoring and management web site. Once setup you can install agents and perform remote desktop session to devices on the local network or over the Internet.
https://meshcentral.com
Apache License 2.0
4.26k stars 571 forks source link

Unbalanced Quoting in systemd .service file #3908

Open Kuuchuu opened 2 years ago

Kuuchuu commented 2 years ago

The Linux MeshCentral service fails to start due to an apostrophe in the site's "title" field in the config.json

status:

Apr 21 17:04:02 solus-blase systemd[1]: /usr/lib/systemd/system/D*sB*sAgent.service:5: Unbalanced quoting, ignoring: "/usr/local/mesh_services/D*'s\x20B*s/D*sB*sAgent/DBAgentv2 --meshServiceName="D*sB*sAgent" --installedByUser=0"
Apr 21 17:04:02 solus-blase systemd[1]: D*sB*sAgent.service: Service has no ExecStart=, ExecStop=, or SuccessAction=. Refusing.

.service file:

[Unit]
Description=D*s B*s agent for remote monitoring, management and assistance.
[Service]
WorkingDirectory=/usr/local/mesh_services/D*'s B*s/D*sB*sAgent/
ExecStart=/usr/local/mesh_services/D*'s\x20B*s/D*sB*sAgent/DBAgentv2 --meshServiceName="D*sB*sAgent" --installedByUser=0
StandardOutput=null
Restart=on-failure
RestartSec=3
[Install]
WantedBy=multi-user.target
Alias=D*sB*sAgent.service

config.json:

  "domains": {
        "": {
    "title": "D*'s B*s",
    "agentCustomization": {
      "displayName": "D*s_B*s",
      "description": "D*s B*s agent for remote monitoring, management and assistance.",
      "companyName": "D*s_B*s",
      "serviceName": "D*sB*sAgent",
      "fileName": "DBAgentv2"
    },
Kuuchuu commented 2 years ago

I noticed there was also a space in the directory path inside the .service file.

After replacing the space with a dash and removing the apostrophe completely, then renaming the offending directory, the service starts successfully and the device is accessible.