I am new to Ubuntu and systemd (was a long time away from Linux) and I was trying out systemctl list-unit-files - oddly it failed with the message "Not a directory". The command systemctl list-units seems to work fine though. I googled around, and looked here, but I couldn't find a mention of this error condition. My installation (16.04.1 LTE) is only a day old, so I hardly think it could be corruption yet.

What is this error, and how should I have gone about finding what was wrong?

  • Just to let you know I have a relatively fresh install of Ubuntu 16.04.1 LTS and systemctl list-unit-files works perfectly. Perhaps you can edit your question and copy & paste in the exact screen contents of calling the conmand and the resulting output. Thanks. – WinEunuuchs2Unix Jan 5 '18 at 20:18
  • Thanks, but I actually found the problem by probing the log. Silly mistake, see my answer. – Mike Wise Jan 5 '18 at 20:31

Ok, poked around in journalctl and got some hints and realized what had gone wrong. I had installed a new Cuda service configuration file with the command:

  cp nvidia-persistenced.service /usr/lib/systemd/system

in the naive assumption that system was a directory that the service configuration file would be copied into. However in reality that system subdirectory did not exist yet, so the cp command just created a file in that place with the name "system". I assume that this in turn confused the systemctl list-unit-files command which was expecting a subdirectory there.

Kind of a silly error, but posting it in case it helps someone else as googling that message turned up nothing . BTW, systemctl list-unit-files works fine now and so do my cuda examples.

  • There are many quirks with nVidia and Linux. Thanks for sharing. – WinEunuuchs2Unix Jan 5 '18 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.