"unrecognised service" for my new systemd script
15,768
The service
command puts the object first:
service foo start
The systemctl
command does the opposite:
systemctl start foo
Related videos on Youtube
Author by
spraff
Updated on September 18, 2022Comments
-
spraff over 1 year
I created a new systemd script
/etc/systemd/system/foo.service
[Unit] Description="My foo script" Before=network-pre.target Wants=network-pre.target [Service] Type=oneshot ExecStart=/usr/local/bin/foo
When I run
service start foo
orservice start foo.service
start: unrecognized service
What's wrong? Ubuntu 16.04
-
spraff over 7 yearsThanks. Mind telling me what I need to do to make it start before networking comes up at boot? (It works correctly as
service foo start
) I thought theBefore=network-pre.target
would be enough but apparently not.