X-Git-Url: http://git.onelab.eu/?p=pl_sshd.git;a=blobdiff_plain;f=pl_sshd.spec;fp=pl_sshd.spec;h=2bc2551ed1a08e4147484538f1548ea3b31716ae;hp=c07ff77d89860e1befc7009598a828e8586e6c89;hb=8e4f5a60c50733819fbc452b224040233429264d;hpb=1d6a93ada4942ec6c10c50c3153e9c7cd06af818 diff --git a/pl_sshd.spec b/pl_sshd.spec index c07ff77..2bc2551 100644 --- a/pl_sshd.spec +++ b/pl_sshd.spec @@ -1,6 +1,6 @@ %define name pl_sshd %define version 1.0 -%define release 9.planetlab%{?date:.%{date}} +%define release 10.planetlab%{?date:.%{date}} Vendor: PlanetLab Packager: PlanetLab Central @@ -51,31 +51,32 @@ rm -rf $RPM_BUILD_ROOT %post # 1 = install, 2 = upgrade/reinstall if [ $1 -ge 1 ]; then - # create the magic directory for automount - keydir=/var/pl_sshd/keys - - # add appropriate entry to auto.master - auto_master=/etc/auto.master - auto_master_entry="$keydir /etc/auto.pl_sshd" - grep -qF "$auto_master_entry" $auto_master || \ - echo $auto_master_entry >>$auto_master - - # - # use the sysconfig file to tell our system sshd to look in the - # magic location for authorized_keys files - # - sysconfig_sshd=/etc/sysconfig/sshd - [ -r $sysconfig_sshd ] && \ - mv $sysconfig_sshd $sysconfig_sshd.pl_sshd - echo "OPTIONS='-o \"AuthorizedKeysFile $keydir/%u/authorized_keys\"'" \ - >$sysconfig_sshd - # link sshd pam config to pl_sshd so that we can actually login pam_pl_sshd=/etc/pam.d/pl_sshd [ -r $pam_pl_sshd ] || ln -s sshd $pam_pl_sshd chkconfig --add pl_sshd + if [ "$1" -gt "1" ]; then # upgrading + # + # remove funky config options for sshd (so that when we restart + # things will operate normally i.e., without automount magic) + # + rm -f /etc/sysconfig/sshd + + # + # stop automounter, remove entry from auto.master, restart if + # necessary + # + [ "$PL_BOOTCD" != "1" ] && /etc/init.d/autofs stop + auto_master=/etc/auto.master + mv $auto_master $auto_master.pl_sshd.post + sed -e '\,^/var/pl_sshd/keys,d' $auto_master.pl_sshd.post \ + >$auto_master + + [ "$PL_BOOTCD" != "1" ] && /etc/init.d/autofs start + fi + if [[ "$PL_BOOTCD" != "1" ]]; then # # don't try to start/restart various things automatically, @@ -101,31 +102,6 @@ if [ $1 -eq 0 ]; then [ "$PL_BOOTCD" = "1" ] || /etc/init.d/pl_sshd stop || : chkconfig --del pl_sshd rm -f /etc/pam.d/pl_sshd - - # - # remove funky config options for sshd (so that when we restart - # things will operate normally i.e., without automount magic) - # - rm /etc/sysconfig/sshd - if [ "$PL_BOOTCD" != "1" ]; then - echo - echo "You need to manually restart sshd." - echo "Make sure you know what you're doing, particularly" - echo "if you're making this change over an ssh connection." - echo - fi - - # - # stop automounter, remove entry from auto.master, restart if - # necessary - # - [ "$PL_BOOTCD" != "1" ] && /etc/init.d/autofs stop - auto_master=/etc/auto.master - mv $auto_master $auto_master.pl_sshd.preun - sed -e '\,^/var/pl_sshd/keys,d' $auto_master.pl_sshd.preun \ - >$auto_master - - [ "$PL_BOOTCD" != "1" ] && /etc/init.d/autofs start fi