Skip to Content.
Sympa Menu

sm-users - Re: [SM-Users] environment variables and preloads

sm-users AT lists.ibiblio.org

Subject: Sourcemage Users List

List archive

Chronological Thread  
  • From: Eric Sandall <eric AT sandall.us>
  • To: Source Mage - Users <sm-users AT lists.ibiblio.org>
  • Subject: Re: [SM-Users] environment variables and preloads
  • Date: Sat, 6 Dec 2003 21:56:51 -0800

Quoting Hamish Greig <hgreig AT bigpond.net.au>:
> looking at a lot of the bugs generated by prometheus, it appears quite a few
>
> spells are adding lines to /etc/profile. but not removing them after dispel.
> To safely add lines and then remove them takes a POST_INSTALL and
> POST_REMOVE
>
> file.
> Another, simpler, less complicated way would be to add
> "for file in /etc/profile.d/* ; do . $file ; done"
> to the /etc/profile file (most probably in bash spell)
> then all the spells that want to set preloads or vars can just install a
> file
>
> to /etc/profile.d/* and it will be sourced at login.
> Later if the spell is dispelled, /etc/profile will remain untouched and the
> file in /etc/profile.d/ will be removed, no POST_INSTALL or POST_REMOVE
> needed.
> This would be a much cleaner implementation of login variable/preload
> setting.
> A few of us talking on IRC thought this would be a good thing to implement
> in
>
> the short term, and as I am off work for a few days I could do this (and
> close a few trivial prometheus bugs at the same time), but wanted feedback
> from others before making such a major change.
> Anyone object to this?
> Anyone want a better explanation ?
> Anyone see problems for non-bash shell users (do we care about them
> anyway ?) ?
> Anyone see any simple flaw we overlooked in discussion on IRC ?
> Hamish

I really like this idea. It's akin to Sergey's idea for the apache
configuration
files. I don't like Sorcery messing with core config files, so it'd be nice if
those core config files (by default) included some user-defined area (such as
/etc/profile.d/ here) for extraneous additions, such as those from spells.
Then
each spell can have it's own addition there, and that can be removed without a
problem (and REAP will protect them if a user modifies them).

One problem I see is what if two packages use the same variables (I am unaware
of any that do this at the moment, but this could come up), then the last one
loaded would take precedence. I guess we'd need a list (perhaps a PROFILES
page
on the wiki, similar to the General Dependencies list) showing which spells
used which variables, so that we don't duplicate.

-sandalle

--
PGP Key Fingerprint: FCFF 26A1 BE21 08F4 BB91 FAED 1D7B 7D74 A8EF DD61
http://search.keyserver.net:11371/pks/lookup?op=get&search=0xA8EFDD61

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/E/IT$ d-- s++:+>: a-- C++(+++) BL++++VIS>$ P+(++) L+++ E-(---) W++ N+@ o?
K? w++++>-- O M-@ V-- PS+(+++) PE(-) Y++(+) PGP++(+) t+() 5++ X(+) R+(++)
tv(--)b++(+++) DI+@ D++(+++) G>+++ e>+++ h---(++) r++ y+
------END GEEK CODE BLOCK------

Eric Sandall | Source Mage GNU/Linux Developer
eric AT sandall.us | http://www.sourcemage.org/
http://eric.sandall.us/ | SysAdmin @ Inst. Shock Physics @ WSU
http://counter.li.org/ #196285 | http://www.shock.wsu.edu/

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




Archive powered by MHonArc 2.6.24.

Top of Page