I have a csh post-installation script that is executed from an rpm
%post with its interpreter line set to
#!/bin/csh (without the
-f option). This should cause the file
/etc/csh.cshrc to be read before executing the rest of the script, according to the man pages for both bsd-csh(1) and tcsh(1). I have certain system-wide environment variable and alias definitions in
/etc/csh.cshrc that the script depends on to function properly. The expected behavior is that when csh executes the script, it picks up the system-wide definitions first, and the script then runs successfully.
This does work, at least initially under certain conditions. The csh script is always called the same way from within the rpm
%post section. However, depending on how the application rpm install is executed, the script may not pick up the expected variables and error out, so it looks to me like it is probably not sourcing
/etc/csh.cshrc at all. The install might be done in a root login shell, via sudo, over ssh, from cron, or initiated from some other process. At least one of these introduces some difference that prevents
/etc/csh.cshrc from being sourced. I don't see anything in the man pages other than the
-f option that would cause this.