I've put together a foo.service file for our foo service that runs as a daemon. The service runs fine when I run systemctl start foo
(and stop
) but systemtcl enable foo
results in Failed to issue method call: Invalid argument
. The unit file is placed in /etc/systemd/system/foo.service
, and has permissions 0755. Setting systemd to debug and running enable gives
Looking for unit files in (highest priority first):` /etc/systemd/system /run/systemd/system /usr/local/lib/systemd/system /usr/lib/systemd/system Looking for SysV init scripts in: /etc/rc.d/init.d Looking for SysV rcN.d links in: /etc/rd.c Failed to issue method call: Invalid argument
Googling around, it seems like systemctl isn't finding the .service file. Is there any way to verify that? If so, how can I fix that? Any other ideas about what might be wrong? Is there more debugging I can enable? The debug info given doesn't really help me narrow down the problem.
foo.service looks like:
[Unit] Description=Blah Blah Blah [Service] ExecStart=/usr/bar/doof/foo Type=simple PIDFile=/var/run/foo.pid [Install] WantedBy=multi-user.target,graphical.target
EDIT: Yes, I did run systemctl daemon-reload
.
The database server requires a Services file, which contains information about the known services on your network. The Services file is typically located in %windir%\System32\drivers\etc\services.
d/ " directories for system services can be placed in /usr/lib/systemd/system or /run/systemd/system directories. Drop-in files in /etc/ take precedence over those in /run/ which in turn take precedence over those in /usr/lib/ .
The next time you boot the system, the service will either start or not start, depending on its default settings. You can use the enable and disable subcommands to manage those defaults. Reboot the system with reboot sudo systemctl reboot , and the service won't automatically start.
For people from Google:
sudo systemd-analyze verify NAME.service
/etc/systemd/system/*.service
sudo systemctl daemon-reload
after changesIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With