#
# Copyright (c) 2004 The Trustees of Princeton University (Trustees).
#
-# $Id: vuseradd,v 1.8 2004/09/22 17:55:12 mlhuang Exp $
+# $Id: vuseradd,v 1.9 2004/10/11 19:03:52 mef Exp $
#
: ${UTIL_VSERVER_VARS:=$(dirname $0)/util-vserver-vars}
groupadd slices 2>/dev/null || :
# add user
-useradd -g slices -s /usr/sbin/vsh $NAME
+useradd -g slices -s /bin/vsh $NAME
# automount keys (eval expands ~)
eval rm -rf ~$NAME/.ssh
for i in %{services} ; do
[ "`/sbin/runlevel`" = "unknown" ] || service $i start
done
-if [ ! -f /etc/shells ] || ! grep -q '^/usr/sbin/vsh$' /etc/shells ; then
- echo /usr/sbin/vsh >> /etc/shells
+if [ ! -f /etc/shells ] || ! grep -q '^/bin/vsh$' /etc/shells ; then
+ echo /bin/vsh >> /etc/shells
fi
+ln -f /usr/sbin/vsh /bin/vsh
%__chattr +t /vservers || :
%postun
# 0 = erase, 1 = upgrade
if [ "$1" = 0 ] ; then
- perl -i -n -e 'next if /^\/usr\/sbin\/vsh$/; print' /etc/shells
+ perl -i -n -e 'next if /^\/bin\/vsh$/; print' /etc/shells
fi
+rm -f /usr/sbin/vsh /bin/vsh
%preun
# 0 = erase, 1 = upgrade
%dir /etc/vservers
%attr(0,root,root) %dir /vservers
%attr(4755,root,root) /usr/sbin/vsh
+%attr(4755,root,root) /bin/vsh
%exclude %_sbindir/newvserver
%exclude %_mandir/man8/newvserver*
for i in %{services} ; do
[ "`/sbin/runlevel`" = "unknown" ] || service $i start
done
-if [ ! -f /etc/shells ] || ! grep -q '^/usr/sbin/vsh$' /etc/shells ; then
- echo /usr/sbin/vsh >> /etc/shells
+if [ ! -f /etc/shells ] || ! grep -q '^/bin/vsh$' /etc/shells ; then
+ echo /bin/vsh >> /etc/shells
fi
+ln -f /usr/sbin/vsh /bin/vsh
%__chattr +t /vservers || :
%postun
# 0 = erase, 1 = upgrade
if [ "$1" = 0 ] ; then
- perl -i -n -e 'next if /^\/usr\/sbin\/vsh$/; print' /etc/shells
+ perl -i -n -e 'next if /^\/bin\/vsh$/; print' /etc/shells
fi
+rm -f /usr/sbin/vsh /bin/vsh
%preun
# 0 = erase, 1 = upgrade
%dir /etc/vservers
%attr(0,root,root) %dir /vservers
%attr(4755,root,root) /usr/sbin/vsh
+%attr(4755,root,root) /bin/vsh
%exclude %_sbindir/newvserver
%exclude %_mandir/man8/newvserver*