Re: <GNOME> Alter shut down behaviour



dirk.debecker@xxxxxxxxx staggered into the Black Sun and said:
I would like to execute a custom piece of code when my system gets
shut down or restarted. I do not know how to make sure that the gnome
shut down buttons will [execute] my custom code.

Unless you're using Slack or Gentoo, it's called "the System V init
script layout". Most of the time, you'll see link farms in /etc/rc$R.d/
where R is 0..6. Shutdown changes the runlevel to 0, reboot changes the
runlevel to 6. All the "K" links in /etc/rc6.d/ are called with an
argument of "stop", then all the "S" links in that dir are called with
an argument of "start".

Some distros have files like /etc/conf.d/local.start and
/etc/conf.d/local.stop, which you can edit to run custom code on startup
and shutdown. You didn't mention which distro you're using, so I can't
tell you what these files are called on your setup. If you say which
version of which distro you're using, someone will be able to tell you
exactly what to do.

--
No man is an island, but then no man is a potato salad, either.
My blog and resume: http://crow202.dyndns.org:8080/wordpress/
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
.


Quantcast