Clicky

I'm racking my brain against the wall, I've put the script where I'd think it would go.

Pretty much when I use the command reboot and/or init6 I want it to suspend my virtual box before it shut's down.  Also if the user in the actual desktop does a shutdown or reboot it does the same thing.

I'm open to suggestions.  thanks!

asked 12/07/2011 07:28

JackTheRipper13's gravatar image

JackTheRipper13 ♦♦


7 Answers:
Post the script here, please
link

answered

shukalo83's gravatar image

shukalo83

the Script is called VBox_suspend, and is placed in /etc/init.d and is set as executable. i created a symlink in /etc/init.d/rc0.d and /etc/init.d/rc6.d called S01VBox_suspend


#! /bin/sh
### BEGIN INIT INFO
# Provides:          Suspends VirtualBox VM
# Required-Start:
# Required-Stop:
# Default-Start:     0 6
# Default-Stop:      1 2 3 5
# Description:       Suspends VM at System Reboot
### END INIT INFO

VBoxManage controlvm VRT savestate
link

answered 2011-12-09 at 02:42:24

JackTheRipper13's gravatar image

JackTheRipper13

It's because of user rights.
Most probably, you started process as a user but in rc0.d everything is run by root.
Test the script as root while playing VM as user and you'll see whats happening

You need to play with setuid or to try /etc/gdm/PostSession

Have a look at this
http://www.linuxquestions.org/questions/linux-desktop-74/gnome-run-script-on-logout-724453/
and this
http://en.wikipedia.org/wiki/Setuid

Just ask if you want me to set this privileges for you. I'm a bit rusty on that so a little exercise would be good.


link

answered 2011-12-09 at 13:17:29

shukalo83's gravatar image

shukalo83

We moved the command to the top of the script and it worked, I guess having it at the bottom was too late in the process.  Thanks for the help!
link

answered 2011-12-11 at 05:14:27

JackTheRipper13's gravatar image

JackTheRipper13

See description

link

answered 2011-12-12 at 07:07:12

JackTheRipper13's gravatar image

JackTheRipper13

I doubt that was the reason. Con you confirm with ls -al who's the owner and grpowner of script?
link

answered 2011-12-12 at 07:07:41

shukalo83's gravatar image

shukalo83

root is the owner, it was that.  Moving it to the top resolved it without any other changes.
link

answered 2011-12-12 at 09:15:09

JackTheRipper13's gravatar image

JackTheRipper13

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×1
×1

Asked: 12/07/2011 07:28

Seen: 253 times

Last updated: 12/16/2011 05:18