Hot answers tagged hibernate
Run sudo crontab -e -u root and append the line @reboot /path/to/script to the bottom of the file, then the root user will automagically run your script as root on login. And a friendly reminder to make sure nobody apart from you and root can access the script, otherwise people could run any command as root.
This script will run on startup. If you really mean this then you are already talking root privileges. What does the rest of your script look like? We can't really judge the security or lack of same from isolated commands. One alternative would be to run it, say, every 5 minutes out of root's crontab. If you are scared of security consequences, you ...
Simpler than adding a script to init.d is to write an Upstart configuration. I'd favour this above all. Create a .conf file in /etc/init (say /etc/init/sleep-on-suspend.conf, containing: description "Automatic suspend" start on runlevel  stop on runlevel  exec /path/to/script This will be automatically started on reboot. You could even ...
Only top voted, non community-wiki answers of a minimum length are eligible