question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support executable prefixes on service files (@, -, :, +, !, !!)

See original GitHub issue

On service files, the ExecStart= option supports extra prefixes (@, -, :, +, !, !!) on the executable path.[1]

image

Currently (v1.4.4147) docker-systemctl-replacement shows an error if prefixes such as !! are used on a ExecStart= option. For example on Debian/Ubuntu when using apt-get to install some package dependencies, it triggers post update hooks, like calling systemd-resolved.service which produces this error:

ERROR:systemctl: systemd-resolved.service: Executable path is not absolute, ignoring: !!/lib/systemd/systemd-resolved

As a temporary workaround until prefixes are supported, an option in most cases is to remove the required symbols:

find /etc /usr/lib /lib -name '*.service' | xargs grep -l 'ExecStart=!!/' | xargs sed -i 's/!!//'

[1] https://www.freedesktop.org/software/systemd/man/systemd.service.html#ExecStart= (version 245)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:4
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
bytestreamcommented, Apr 29, 2022

Seems like MySQL 8.0.29 is now using:

ExecStartPre=+/usr/share/mysql-8.0/mysql-systemd-start pre

This fails on master branch, but develop branch appears to work well.

1reaction
EzraBrookscommented, Jun 30, 2021

Just because tools like systemd-resolved and systemd-timesyncd “shouldn’t” run in a container doesn’t mean there aren’t use cases. For instance, I use Docker to unit test Ansible roles that later run on full-fat systems. I can’t systemctl restart systemd-timesyncd with this script, which means it’s unusable in my NTP configuration test.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Systemd - using the "+" prefix with ExecStartPre
I want to run /usr/bin/tomcat1 with elevated privileges, but doing so with the "+" sign gives the following error (note, "-" does not...
Read more >
systemd.service - Freedesktop.org
A unit configuration file whose name ends in " .service " encodes information ... Note that these prefixes are also supported for the...
Read more >
File and Folder Prefix Variables - TechDocs - Broadcom Inc.
COMMON_DOCUMENTS. The file system folder that contains documents that are common to all users: C:\Documents and Settings\All Users\Documents. ( ...
Read more >
Naming Files, Paths, and Namespaces - Win32 apps
All file systems supported by Windows use the concept of files and ... vary depending on the file system and path name prefix...
Read more >
Prefix: The Developer's Code Profiling and Tracing Sidekick
Stop sorting through messy log files. Prefix brings all of your logs together in a consolidated log viewer to quickly locate issues, explore...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found