[oi-dev] /etc/profile.d and /etc/csh/login.d directories

Alexander Pyhalov alp at rsu.ru
Fri Nov 29 07:44:02 UTC 2013


Good morning.

On 11/28/2013 13:36, Jonathan Adams wrote:
> I know this sounds silly, because a standard of sorts already exists (other
> platforms use something similar), but can we not have a common subdirectory
> in /etc for these scripts, e.g. /etc/shell.d with the relevant
> shells/scripts as subdirectories. e.g. /etc/shell.d/profile and
> /etc/shell.d/login ?

I don't think that this is a good idea. It would be confusing. I like 
/etc/profile.d . Perhaps, I'd prefer to use /etc/profile.d/*.sh for sh 
scripts and /etc/profile.d/*.csh for csh. But if /etc/csh/login.d is 
used by Debian, why not do it in a more widespread way?

>
> it just seems slightly better organised.
>
> just as a suggestion, which you are free to ignore, when you get a new
> Apache2 server set up on an Ubuntu box, you get the "sites-available" and
> "sites-enabled" directories. All available scripts/setup are in
> sites-available, and if they are wanted they are soft-linked into the
> sites-enabled directory ... do we want to consider doing something like
> this for shell scripts?

I don't know if IPS can deliver link "on install". So, if admin later 
removes a link, it doesn't reappear on pkg update.


> Just out of interest, how did you envisage sorting the run order for the
> scripts in the subdirectories? Are we planning on instigating the 2 digit
> leading order, in a similar fashion to the rc.d scripts? if we were, then
> we could check for filenames beginning with numbers, which would allow
> "README" and other documentation to exist in those directories that isn't
> run automatically.

By default, scripts are read in alphabetical order due to shell patterns 
expansion rule. I don't think that it has sense to support any 
particular execution order there. This is a place for additional 
customizations, which can be skipped/ignored (it seems that on Linux 
/etc/profile.d/* scripts are used mostly for different auto-completion 
rules).
-- 
Best regards,
Alexander Pyhalov,
system administrator of Computer Center of Southern Federal University




More information about the oi-dev mailing list