Skip to content

Commit

Permalink
krb5: improve RC scripts, relbump
Browse files Browse the repository at this point in the history
  • Loading branch information
sighook committed Nov 19, 2024
1 parent 2d628d6 commit af62b7a
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 32 deletions.
3 changes: 3 additions & 0 deletions krb5/.footprint
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ drwxr-xr-x root/root bin/
-rwsr-xr-x root/root bin/ksu
drwxr-xr-x root/root etc/
drwxr-xr-x root/root etc/rc.d/
-rwxr-xr-x root/root etc/rc.d/kadmind
-rwxr-xr-x root/root etc/rc.d/kpropd
-rwxr-xr-x root/root etc/rc.d/krb5
-rwxr-xr-x root/root etc/rc.d/krb5kdc
drwxr-xr-x root/root lib/
lrwxrwxrwx root/root lib/libk5crypto.so.3 -> libk5crypto.so.3.1
-rwxr-xr-x root/root lib/libk5crypto.so.3.1
Expand Down
5 changes: 4 additions & 1 deletion krb5/.md5sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
beb34d1dfc72ba0571ce72bed03e06eb krb5-1.21.3.tar.gz
b8ef6658d4d1057ed17081a29eb1e706 rc.krb5
6dd2e9f47e537fdbb5966a307a175a92 rc.kadmind
f6b968dee400c2e819ea8a03ed653503 rc.kpropd
c0955a05e275b12e76fe5c31c8378a10 rc.krb5
5cc66fb80a5e95ea94273eb0459bae42 rc.krb5kdc
16 changes: 10 additions & 6 deletions krb5/Pkgfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@

name=krb5
version=1.21.3
release=1
release=2
source="https://kerberos.org/dist/krb5/${version%.*}/krb5-$version.tar.gz
rc.krb5"
rc.kadmind
rc.kpropd
rc.krb5
rc.krb5kdc"

build() {
cd $name-$version/src
Expand All @@ -24,7 +27,6 @@ build() {
--enable-shared \
--disable-rpath \
--disable-nls \
--without-tcl \
--with-system-et \
--with-system-ss \
--without-system-verto \
Expand All @@ -33,7 +35,7 @@ build() {
make V=1
make DESTDIR=$PKG install

# move essential libs and the ksu binary to /lib resp. /bin
# move essential libs and the ksu binary from /usr to /
mkdir -p $PKG/bin $PKG/lib
mv $PKG/usr/bin/ksu $PKG/bin
mv $PKG/usr/lib/libkrb5.so.3* $PKG/lib
Expand All @@ -46,8 +48,10 @@ build() {

install -m 0644 -Dt $PKG/usr/share/aclocal util/ac_check_krb5.m4

# service
install -m 0755 -D $SRC/rc.krb5 $PKG/etc/rc.d/krb5
# services
for f in kadmind kpropd krb5 krb5kdc; do
install -m 0755 -D $SRC/rc.$f $PKG/etc/rc.d/$f
done

# cleanup
rm -r $PKG/usr/share/examples $PKG/usr/share/man/cat* $PKG/run
Expand Down
33 changes: 33 additions & 0 deletions krb5/rc.kadmind
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh
#
# /etc/rc.d/kadmind: start/stop kadmind(8) KADM5 administration server
#

SSD=/sbin/start-stop-daemon
PROG=/usr/sbin/kadmind

case $1 in
start)
$SSD --start --exec $PROG
;;
stop)
$SSD --stop --retry 10 --exec $PROG
;;
restart)
$0 stop
$0 start
;;
status)
$SSD --status --exec $PROG
case $? in
0) echo "$PROG is running with pid $(pidof $PROG)" ;;
1|3) echo "$PROG is not running" ;;
4) echo "Unable to determine the program status" ;;
esac
;;
*)
echo "usage: $0 [start|stop|restart|status]"
;;
esac

# End of file.
33 changes: 33 additions & 0 deletions krb5/rc.kpropd
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh
#
# /etc/rc.d/kpropd: start/stop kpropd(8) Kerberos V5 replica KDC update server
#

SSD=/sbin/start-stop-daemon
PROG=/usr/sbin/kpropd

case $1 in
start)
$SSD --start --exec $PROG
;;
stop)
$SSD --stop --retry 10 --exec $PROG
;;
restart)
$0 stop
$0 start
;;
status)
$SSD --status --exec $PROG
case $? in
0) echo "$PROG is running with pid $(pidof $PROG)" ;;
1|3) echo "$PROG is not running" ;;
4) echo "Unable to determine the program status" ;;
esac
;;
*)
echo "usage: $0 [start|stop|restart|status]"
;;
esac

# End of file.
35 changes: 10 additions & 25 deletions krb5/rc.krb5
Original file line number Diff line number Diff line change
@@ -1,42 +1,27 @@
#!/bin/sh
#
# /etc/rc.d/samba: start/stop krb5 daemons
# /etc/rc.d/krb5: start/stop krb5 daemons
#

SSD=/sbin/start-stop-daemon
KRB5KDC=/usr/sbin/krb5kdc
KADMIND=/usr/sbin/kadmind
KPROPD=/usr/sbin/kpropd

print_status() {
$SSD --status --exec $1

case $? in
0) echo "$1 is running with pid $(pidof $1)" ;;
1|3) echo "$1 is not running" ;;
4) echo "Unable to determine the program status" ;;
esac
}

case $1 in
start)
$SSD --start --exec $KRB5KDC
$SSD --start --exec $KADMIND
$SSD --start --exec $KPROPD
/etc/rc.d/krb5kdc start
/etc/rc.d/kadmind start
/etc/rc.d/kpropd start
;;
stop)
$SSD --stop --retry 10 --exec $KPROPD
$SSD --stop --retry 10 --exec $KADMIND
$SSD --stop --retry 10 --exec $KRB5KDC
/etc/rc.d/krb5kdc stop
/etc/rc.d/kadmind stop
/etc/rc.d/kpropd stop
;;
restart)
$0 stop
$0 start
;;
status)
print_status $KRB5KDC
print_status $KADMIND
print_status $KPROPD
/etc/rc.d/krb5kdc restart
/etc/rc.d/kadmind restart
/etc/rc.d/kpropd restart
;;
*)
echo "usage: $0 [start|stop|restart|status]"
Expand Down
33 changes: 33 additions & 0 deletions krb5/rc.krb5kdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh
#
# /etc/rc.d/krb5kdc: start/stop krb5kdc(8) Kerberos V5 KDC
#

SSD=/sbin/start-stop-daemon
PROG=/usr/sbin/krb5kdc

case $1 in
start)
$SSD --start --exec $PROG
;;
stop)
$SSD --stop --retry 10 --exec $PROG
;;
restart)
$0 stop
$0 start
;;
status)
$SSD --status --exec $PROG
case $? in
0) echo "$PROG is running with pid $(pidof $PROG)" ;;
1|3) echo "$PROG is not running" ;;
4) echo "Unable to determine the program status" ;;
esac
;;
*)
echo "usage: $0 [start|stop|restart|status]"
;;
esac

# End of file.

0 comments on commit af62b7a

Please sign in to comment.