Custom Scripts

5 views
Skip to first unread message

n...@gmail.com

unread,
Aug 30, 2007, 8:39:12 PM8/30/07
to slack users
I'd like to know which roles are installed on my machines, and when
they were last updated. I've heard that this is a common request.

I played around with this idea and started to think of ways to add
custom scripts that get executed for all roles. Common tasks that are
not specific to a particular role are good examples, like logging of
some sort.

An example might make it more clear:

So in the slack script, the preinstall, postinstall, and fixfiles
scripts get called for each role. There could be another directory
somewhere, say /slack_scripts that contains a bunch custom scripts.
Each one in that directory would get called by slack and be given the
name of the current role as a parameter.

If /slack_scripts contained a script called logging.sh, it will get
called like ./logging somerole

That script could do whatever you want.

If you want to be able to run a script before the installation, and
another one after the installation, you could have various locations
like:
/slack_scripts/pre and /slack_scripts/post.

So the basic idea is to tell slack to look in 1 (or more, if you want
to be able to do the pre/post stuff) locations for scripts to execute.
To add logging, you just create a logging script in the appropriate
location, you don't need to change slack.

The basic idea is simple to implement. The location of the scripts can
be found in a configuration file located in /etc/slack.conf.

I'd like to implement this feature and submit a patch, but I want
feedback from the community first.

What is expected if the custom script crashes?
- Just keep on truckin?
- Bail?
- Make it configurable? Each script could specify somehow if slack
should go on or not when if it crashes.
Should the script be run if one of the core slack scripts fails?
- Configurable? Some do, some don't?
- maybe just call the script everytime regardless of success/fail, but
make the second argument to the script the exit code?

Let me know what you think.
Thanks
--
N

Reply all
Reply to author
Forward
0 new messages