On Tue, Mar 18, 2014 at 10:07:00AM +0100, Lionel Cons wrote:
> On 17 March 2014 10:02, Franz Schmidt <[email protected]> wrote:
> > Hi list,
> >
> > is any of you using ksh on Linux? I have a problem with RedHat 6 systems
> > where the link /usr/bin/ksh -> / bin/ksh is missing, which breaks existing
> > scripts...
> >
> > Would be interested if somebody has the same issue.
> > There's an entry in the RH support portal, but no access without $$$.
> > https://access.redhat.com/site/solutions/59186
> 
> CCing ast-users. My guess is that the link is part of an extra package
> or config script.
> 
> Michal?
> 
> Lionel

Hi,

On our systems the /bin/ksh link is created when ksh is installed. It uses the 
alternatives system:
$ rpm -q --scripts ksh
postinstall scriptlet (using /bin/sh):
if [ ! -f /etc/shells ]; then
        echo "/bin/ksh" > /etc/shells
else
        if ! grep -q '^/bin/ksh$' /etc/shells ; then
                echo "/bin/ksh" >> /etc/shells
        fi
fi

/usr/sbin/alternatives --install /bin/ksh ksh \
                /bin/ksh93 50 \
        --slave /usr/share/man/man1/ksh.1.gz ksh-man \
                /usr/share/man/man1/ksh93.1.gz

#if not symlink we are updating ksh where there was no alternatives before
#so replace with symlink and set alternatives
if [ ! -L /bin/ksh ]; then
        /usr/sbin/alternatives --auto ksh
        ln -sf /etc/alternatives/ksh /bin/ksh
        ln -sf /etc/alternatives/ksh-man /usr/share/man/man1/ksh.1.gz
fi
preuninstall scriptlet (using /bin/sh):
if [ $1 = 0 ]; then
        /usr/sbin/alternatives --remove ksh /bin/ksh93
fi
postuninstall scriptlet (using /bin/sh):
if [ ! -f /bin/ksh ]; then
        sed -i '/^\/bin\/ksh$/ d' /etc/shells
fi
verify scriptlet:
echo -n "Looking for ksh in /etc/shells... "
if ! grep '^/bin/ksh$' /etc/shells > /dev/null; then
    echo "missing"
    echo "ksh missing from /etc/shells" >&2
else
    echo "found"
fi
$ 


peter



_______________________________________________
ast-users mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-users

Reply via email to