Shutdown takes a long time as of 2389


I noticed that shutting down Volumio takes more than one minute on my RPI3+HifiBerry Pro system as of version 2389. The latest update to 2411 didn’t make this better.
In earlier versions, shutdown was completed within seconds. Does anybody have any glue about this?


Do you have a nas mounted?

Yes, I do. All my music files are on a WD MyCloud network drive.

Just for comparison & reference I have a similar hardware setup to you with RPi3B & HiBerry & 2.411 image, but using USB stick for MP3 storage. Shutdown takes around 5…10 seconds.

Obviously something going on in the background is hanging on to the system. Possibly NAS not being unmounted; you could try looking at the system logs to see if anything is thrown out … … oting.html or ‘sudo journalctl -b’ from ssh session.

I generated a log file with journalctl -b but it doesn’t seem to contain anything about the shutdown sequence:
Is there a way to disable the boot and shutdown splash screens? So I could see the messages during shutdown on my 5" display attached.

BTW, the mass of getState messages obviously come from a shell script written by me. I need it to control GPIO buttons (I don’t use the GPIO plugin, long story). The shell script is started automatically and is running in background all the time. It uses the volumio command line client and it interfaces the GPIO buttons via /sys/class/gpio.
I hope this has nothing to do with the shutdown problem. Disabling the shell script doesn’t speed up the shutdown sequence.

Sorry, not thinking straight here, log won’t record anything about shutdown.

If you have been adding stuff, then I think that I would go back to a clean installation or factory reset, and just check that the shutdown occurs as you expect. You can then add your script and see if it has any effect.

Just to add another experience here my latest update Volumio shuts down in 3-5 seconds.
Version 2.389 was the same speed

I wish you well in finding the cause, as suggested a fresh instal and only adding plugins one at a time until you notice a change.

I disabled the boot splash screen. So I can see the shutdown messages. The one which takes long is the following:
(1 of 2) A stop job is running for /mnt/NAS/NAS (42s / 1min 32s)

It must have something to do with the samba drives where my music files are stored. The problem does not occur if I unmount the samba drives manually before shutdown.
Google told me about others having similar problems with some Linux installations in general.

My last try will be a fresh install, definitely.

The last kernel broght an awful lot of issues with SMB… So reflashing will not help… But since you’re skilled it would help indeed if you could help us understand what goes wrong, and we could fix it together :wink:

Of course I will help you sorting out the SMB issues (if I can). Just tell me what I should try.
I found some hints at Google identifying this as a timing problem. Networking may already be down when systemd unmounts the drives (no idea how to fix this).

Interesting, indeed.
Probably we should unmount the drives before executing the shutdown or reboot commnd then…
thanks for the hint!

This would help indeed. Does that mean that everybody will have to use a “special volumio function” to shutdown the system?
Or is there a way to tell systemd the right order for stopping services?

We can just add a function on the networkfs plugin : onVolumioShutdown which will just unmount all the drives, and once done it will execute the shutdown.

Will the plugin also affect the ‘shutdown’, ‘halt’, ‘reboot’ commands?

I just released an image with a fix for this behaviour. Can you put in test mode, update and tell me how it goes?

I installed the new test release.
Shutdown via volumio menu command is much faster just after reboot or while playing internet radio.
While or after playing a file from my NAS shutdown via menu command takes 1:43 (as long as before). Maybe the samba drives could’t be unmounted before shutdown because they were “busy”.

Shutdown via GPIO button takes as long as before, no matter what I played in volumio. The GPIO button is handled by a self-written shell script which just executes the “halt” command.

Adding the samba mounts to /etc/fstab solved the problem for me. Shutdown is now as fast as expected, in any situation.

@michelangelo: Would it be possible that volumio maintains /etc/fstab to avoid long shutdowns in NAS environments?

Seems the problem is gone with the latest release.