1

I have the following Upstart script saved as /etc/init/automount.conf:

description     "SOME DESCRIPTION"

start on startup

task
exec mount -t vboxsf WebApps -o rw,dmode=777,gid=GROUP_ID,uid=USER_ID /var/virtual/some_folder_name

where GROUP_ID and USER_ID is some number I took from /etc/passwd

Previously before I upgraded my ubuntu from 12.10 to 14.04, this was working. After I upgraded it, I also upgraded the virtual box from 4.3.8 to 4.3.10. Subsequently, I think there was an issue with 4.3.10. So I downgraded the virtual box back to 4.3.8.

Now everything is working with the shared folders. Unfortunately, this script is not executed, I believe. The reason is because, the mount is not happening on start up.

I can still execute the command without any problem whatsoever. Why isn't Upstart able to run this any more? How can I tell what the problem is?

Oli
  • 293,335
Kim Stacks
  • 1,076

1 Answers1

3

By default Upstart should be logging what it's doing to /var/log/upstart/automount.log. That will show you output from it trying to run (and in doing so, should let you know roughly what the problem is).

Nothing in there? Try a sudo start automount and see what that does for things. If that works (and things are mounted), it's likely your start on startup line needs to change. It's possible that something else hasn't started up (I'm not sure what vboxsf requires) so delaying it until later might work.

However, in your case I'd be tempted to drop the script completely and just use the more regular method of mounting things /etc/fstab. We already have a question with an answer that goes down this route:

That's much more logical way of handling this (IMO). You can still pass in all the options, it's just rearranged to something (I haven't tested so you might need to jumble things) like:

WebApps  /var/virtual/some_folder_name  vboxsf  rw,dmode=777,gid=GROUP_ID,uid=USER_ID  0 0
Oli
  • 293,335
  • Thank you. I did not understand the /etc/fstab because the shared folder was already mounted in my guest OS. I wanted to share it under the /var/virtual folder which is where nginx will run the files and have a different permissions rather than root:vboxsf. I changed to start on starting and the situation worked. As you mentioned, something is not working for start on startup. Everything else was okay. If you have an alternative on how I can use /etc/fstab, especially since Ubuntu is going to discontinue the upstart, I will be happy to hear. :) – Kim Stacks May 03 '14 at 10:10
  • http://superuser.com/q/527963 explains the motivation for me to use this script. – Kim Stacks May 03 '14 at 10:15
  • 1
    I've added what I'd expect the fstab line to look like. – Oli May 03 '14 at 10:44