You are not logged in.
So I am trying to create a script that runs whenever crunchbang is shutdown (via either the super-x gui interface, or just typing sudo poweroff into the terminal)
I followed the instructions here:
http://ubuntuforums.org/showthread.php?t=185261
added the script to /etc/init.d, created the symlink to the script in rc0.d and rc6.d, but nothing happens (specifically, its supposed to write uptime to a text file)
I tried renaming the link to K01shutdown.sh in case the command couldnt be executed later on in the shutdown process or something, but still nothing happens.
Any thoughts would be greatly appreciated 
Last edited by BruceJohnJennerLawso (2014-08-11 20:55:05)
Offline
You can probably modify the way I do it for a shutdown sound, by adding a command to /usr/bin/cb-exit.
def shutdown_action(self,btn):
self.disable_buttons()
self.status.set_label("Shutting down, please standby...")
Add -> os.system("command-or-script-you-want--to-run")
os.system("dbus-send --system --print-reply --dest=\"org.freedesktop.ConsoleKit\" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop")Last edited by damo (2014-08-11 21:09:47)
Artwork at deviantArt; Iceweasel Personas; SLiM #! Themes; Openbox themes
Online
You can probably modify the way I do it for a shutdown sound, by adding a command to /usr/bin/cb-exit.
def shutdown_action(self,btn): self.disable_buttons() self.status.set_label("Shutting down, please standby...") Add -> os.system("command-or-script-you-want--to-run") os.system("dbus-send --system --print-reply --dest=\"org.freedesktop.ConsoleKit\" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop")
Thanks Damo, that worked (although I discovered that naming a script shutdown was bad, since there seems to be another program with that name)
I still dont understand why the previous method did not work though
Offline
http://www.thegeekstuff.com/2012/03/lsbinit-script/
The stuff of nightmares. 
Round off #! Waldorf Part I - Part II
Scripts | Run new applications | Thunar 1.6.3 | Default soundcard | Settings daemon
On mixing sources 
Offline
Thanks Damo, that worked (although I discovered that naming a script shutdown was bad, since there seems to be another program with that name)

Always handy to check a script name with:
$ which shutdown
/sbin/shutdownArtwork at deviantArt; Iceweasel Personas; SLiM #! Themes; Openbox themes
Online
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.