10 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
13 Packager: PlanetLab Central <support@planet-lab.org>
14 Distribution: PlanetLab %{plrelease}
15 URL: %(echo %{url} | cut -d ' ' -f 2)
17 Summary: SSH server config for PlanetLab
21 Requires: openssh-server
23 Group: System Environment/Base
24 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
26 Source0: %{name}-%{version}.tar.bz2
29 SSH server configuration for PlanetLab nodes. Configures an automounted
30 directory as source for authorized_keys files and points sshd to that
40 mkdir -p $RPM_BUILD_ROOT/var/pl_sshd/keys
41 install -D -m 0755 pl_sshd.sh $RPM_BUILD_ROOT/usr/local/sbin/pl_sshd
42 install -D -m 0755 pl_sshd $RPM_BUILD_ROOT/etc/init.d/pl_sshd
45 rm -rf $RPM_BUILD_ROOT
49 %dir /var/pl_sshd/keys
50 %attr(0755,root,root) /usr/local/sbin/pl_sshd
51 %attr(0755,root,root) /etc/init.d/pl_sshd
57 # 1 = install, 2 = upgrade/reinstall
59 # link sshd pam config to pl_sshd so that we can actually login
60 pam_pl_sshd=/etc/pam.d/pl_sshd
61 [ -r $pam_pl_sshd ] || ln -s sshd $pam_pl_sshd
63 chkconfig --add pl_sshd
65 if [ "$1" -gt "1" ]; then # upgrading
67 # remove funky config options for sshd (so that when we restart
68 # things will operate normally i.e., without automount magic)
70 rm -f /etc/sysconfig/sshd
73 # stop automounter, remove entry from auto.master, restart if
76 [ "$PL_BOOTCD" != "1" ] && /etc/init.d/autofs stop
77 auto_master=/etc/auto.master
79 backup=$auto_master.pl_sshd.post
81 sed -e '\,^/var/pl_sshd/keys,d' $backup > $orig && rm $backup || \
84 [ "$PL_BOOTCD" != "1" ] && /etc/init.d/autofs start
87 if [[ "$PL_BOOTCD" != "1" ]]; then
89 # don't try to start/restart various things automatically,
90 # it's too ugly (particularly if we're upgrading while
94 echo "You need to manually restart autofs and sshd, and"
95 echo "start the pl_sshd (ssh on port 806) service."
96 echo "Make sure you know what you're doing, particularly"
97 echo "if you're making this change over an ssh connection."
103 # 0 = erase, 1 = upgrade
104 if [ $1 -eq 0 ]; then
106 # stop pl_sshd, remove it from rcX.d init dirs, remove link
107 # to sshd's pam config
109 [ "$PL_BOOTCD" = "1" ] || /etc/init.d/pl_sshd stop || :
110 chkconfig --del pl_sshd
111 rm -f /etc/pam.d/pl_sshd
119 * Wed Nov 2 2005 Steve Muir <smuir@cs.princeton.edu>
120 - don't fanny around using the automounter to access ssh keys in vservers,
121 pl_conf now writes them into the normal locations
123 * Wed Oct 12 2005 Steve Muir <smuir@cs.princeton.edu>
124 - fix pl_sshd script name and argv[0] to satisfy re-exec requirements
126 * Thu Apr 7 2005 Steve Muir <smuir@cs.princeton.edu>
127 - convert auto.pl_sshd to a python script (simpler and less error-prone)
129 * Mon Dec 1 2003 Steve Muir <smuir@cs.princeton.edu>
130 - initial creation from files in sidewinder repository