I was having the same trouble with my Pi - I could run "sudo mount -a" and the CIFS shares would mount normally from the entries in /etc/fstab, but when I restarted, the shares would not mount on boot.
I checked dmesg and saw some socket errors and figured the network wasn't up, but I couldn't get the shares to mount after the network came up. I found a ton of similar threads and tried each of the suggestions, including -
- adding various parameters to the fstab entry (_netdev, users, nosers, nosuid, the list goes on, but none seemed to help)
- adding scripts to /etc/network/if-up.d/ and a post-up entry in /etc/network/interfaces, again, didn't help, same error
- I started trying autofs, but abandoned that as it seemed overly complex, and my initial attempts at set up failed
The suggestion to add a script to ~/.bash_profile helped me when I realized I didn't have nmcli installed - basically, I had to install the network-manager package.
I ran "sudo apt-get update" and then "sudo apt-get install network-manager" and then rebooted the Pi.
Success! The shares were mounted!
My guess is that some of the network timing dependent functions in the OS use network-manager in one way or another.
Either way, I hope this helps someone, as I was unable to get my Pi to mount CIFS shares at boot, which seemed basic enough.