Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

systemd - What does "Failed to execute operation: Invalid argument" mean when running systemctl enable?

I've created a systemd service file (specifically for svnserve; I'm actually using the example from here https://stackoverflow.com/a/40584047/464087), and when I enable it, typing

sudo systemctl enable svnserve

I get the response

Failed to execute operation: Invalid argument

Running

sudo systemctl status svnserve

yields

● svnserve.service - Subversion protocol daemon
   Loaded: loaded (/etc/systemd/system/svnserve.service; enabled; vendor preset: enabled)
   Active: inactive (dead)

not giving me any clue about anything being wrong. I can then start the service without any error, and it seems to be running as expected, and after starting systemctl status I still get no clue about anything being wrong:

● svnserve.service - Subversion protocol daemon
   Loaded: loaded (/etc/systemd/system/svnserve.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2018-01-09 22:10:14 UTC; 6s ago
  Process: 9677 ExecStart=/usr/bin/svnserve $DAEMON_ARGS (code=exited, status=0/SUCCESS)
 Main PID: 9678 (svnserve)
    Tasks: 1
   Memory: 964.0K
      CPU: 2ms
   CGroup: /system.slice/svnserve.service
           └─9678 /usr/bin/svnserve --daemon --pid-file /run/svnserve/svnserve.pid --root /srv/svn/repos --log-file /var/log/svnserve/svnserve.log

So what does this error message mean? And to which level of things is "invalid argument" supposed to apply? An argument to the svnserve command? Some property in the service file? A command line argument to the servicectl command itself?

FWIW this is on a Ubuntu 16.04 LTS server.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I had a similar case, in my case problem went away after removing the Alias line from the [Install] section. Thanks to Anton in another thread: https://stackoverflow.com/a/34978908/2711456 - alias' name may not be the same as service name.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...