Hello community, here is the log from the commit of package atftp for openSUSE:Factory checked in at Tue Jan 18 12:19:21 CET 2011. -------- --- atftp/atftp.changes 2010-09-22 08:40:08.000000000 +0200 +++ atftp/atftp.changes 2010-10-30 01:24:23.000000000 +0200 @@ -1,0 +2,28 @@ +Fri Oct 29 23:18:57 UTC 2010 - chris@computersalat.de + +- cleanup spec + o RPM_BUILD_ROOT vs buildroot +- fix pre + o no check before addding group/user (darix) +- fix files + o provide /srv/tftpboot +- modify sysconfig + o provide defaults (darix) + +------------------------------------------------------------------- +Wed Oct 13 21:28:56 UTC 2010 - chris@computersalat.de + +- modified init/sysconfig file + o set defaults in init file +- added default group/user tftp:tftp (bnc#472282) +- added /srv/tftpboot as default ATFTPD_DIRECTORY (bnc#248008,507011) +- added logrotate script + o --logfile /var/log/atftpd/atftp.log +- added missing README.MCAST, README.PCRE +- some rpmlint stuff + o fixed missing-dependency-to-logrotate + o fixed init non-remote_fs-dependency + o fixed init no-reload-entry + o fixed non-conffile-in-etc + +------------------------------------------------------------------- @@ -4 +32 @@ -- add missing pcre-devel to build Requires +- add missing pcre-devel to build Requires (bnc#537425) calling whatdependson for head-i586 New: ---- atftpd.logrotate ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ atftp.spec ++++++ --- /var/tmp/diff_new_pack.iFPqFN/_old 2011-01-18 12:16:25.000000000 +0100 +++ /var/tmp/diff_new_pack.iFPqFN/_new 2011-01-18 12:16:25.000000000 +0100 @@ -1,7 +1,7 @@ # -# spec file for package atftp (Version 0.7.0) +# spec file for package atftp # -# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,21 +17,19 @@ # norootforbuild +%define pkg_version 0.7 Name: atftp -%define pkg_version 0.7 +Summary: Advanced TFTP Server and Client Version: 0.7.0 -Release: 139 +Release: 140 License: GPLv2+ Group: System/Daemons -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: pcre-devel readline-devel tcpd-devel -PreReq: %insserv_prereq %fillup_prereq -Conflicts: tftp Url: ftp://ftp.mamalinux.com/pub/atftp/ Source: %{name}-%{pkg_version}.tar.bz2 Source1: atftpd.init.d Source2: atftpd.sysconfig +Source3: atftpd.logrotate Patch1: atftp-0.7.dif Patch2: atftp-CLK_TCK.diff Patch3: atftp-0.7_compiler_warnings.patch @@ -40,8 +38,12 @@ Patch6: atftp-0.7_bug-213384_OPT_NUMBER.patch Patch7: atftpd-0.7_unprotected_assignments_crash.patch Patch8: atftpd-0.7_circumvent_tftp_size_restrictions.patch -# -Summary: Advanced TFTP Server and Client +BuildRoot: %{_tmppath}/%{name}-%{version}-build +PreReq: %insserv_prereq %fillup_prereq +BuildRequires: pwdutils +BuildRequires: pcre-devel readline-devel tcpd-devel +Conflicts: tftp +Recommends: logrotate %description atftp stands for Advanced Trivial File Transfer Protocol. It is called @@ -81,10 +83,23 @@ %{__install} -D -m 0755 %{S:1} %{buildroot}/etc/init.d/atftpd %{__ln_s} -f ../../etc/init.d/atftpd %{buildroot}%{_sbindir}/rcatftpd %{__install} -D -m 0644 %{S:2} %{buildroot}/var/adm/fillup-templates/sysconfig.atftpd -%{__install} -Dd -m 0750 %{buildroot}/var/run/atftpd/ - -%clean -%{__rm} -rf %{buildroot} +%{__install} -D -m 0644 %{S:3} %{buildroot}/etc/logrotate.d/%{name} +%{__install} -d -m 0750 %{buildroot}/srv/tftpboot +%{__install} -d -m 0750 %{buildroot}/var/log/atftpd + +%pre +# This group/user is shared with tftp, so please +# keep this in sync with tftp.spec +# add group +%{_sbindir}/groupadd -r tftp 2>/dev/null || : +# add user +%{_sbindir}/useradd -c "TFTP account" -d /srv/tftpboot -G tftp -g tftp \ + -r -s /bin/false tftp 2>/dev/null || : +# fix sysconfig to get new defaults on Update +if [ -f /etc/sysconfig/atftpd ]; then + %{__sed} -i -e "s@^(ATFTPD_OPTIONS="--daemon ")@#\1@" /etc/sysconfig/atftpd + %{__sed} -i -e "s@^(ATFTPD_DIRECTORY="/tftpboot")@#\1@" /etc/sysconfig/atftpd +fi %preun %stop_on_removal atftpd @@ -96,18 +111,23 @@ %restart_on_update atftpd %{insserv_cleanup} +%clean +%{__rm} -rf %{buildroot} + %files %defattr(-,root,root) -%doc BUGS FAQ LICENSE README TODO +%doc BUGS FAQ LICENSE README README.MCAST README.PCRE TODO %{_bindir}/atftp %{_sbindir}/atftpd %{_sbindir}/in.tftpd %{_sbindir}/rcatftpd /etc/init.d/atftpd +%config /etc/logrotate.d/%{name} /var/adm/fillup-templates/sysconfig.atftpd %{_mandir}/man1/atftp.1.gz %{_mandir}/man8/atftpd.8.gz %{_mandir}/man8/in.tftpd.8.gz -%dir %attr(-,nobody,nogroup) /var/run/atftpd/ +%dir %attr(0750,root,tftp) /srv/tftpboot +%dir %attr(0750,tftp,root) /var/log/atftpd/ %changelog ++++++ atftpd.init.d ++++++ --- /var/tmp/diff_new_pack.iFPqFN/_old 2011-01-18 12:16:25.000000000 +0100 +++ /var/tmp/diff_new_pack.iFPqFN/_new 2011-01-18 12:16:25.000000000 +0100 @@ -10,12 +10,13 @@ # ### BEGIN INIT INFO -# Provides: atftpd -# Required-Start: $remote_fs $syslog -# Required-Stop: $remote_fs $syslog -# Default-Start: 3 5 -# Default-Stop: 0 1 2 6 -# Description: launch atftpd server +# Provides: atftpd +# Required-Start: $syslog $remote_fs +# Required-Stop: $syslog $remote_fs +# Default-Start: 3 5 +# Default-Stop: 0 1 2 6 +# Short-Description: launch atftpd server +# Description: launch Advanced TFTP Server ### END INIT INFO # Shell functions sourced from /etc/rc.status: @@ -47,46 +48,75 @@ # with force-reload (in case signalling is not supported) are # considered a success. -ATFTPD_BIN="/usr/sbin/atftpd" -if [ ! -x $ATFTPD_BIN ]; then - echo -n "Advanced Trivial FTP server, $ATFTPD_BIN is not installed." +ATFTP_BIN="/usr/sbin/atftpd" +if [ ! -x $ATFTP_BIN ]; then + echo -n "Advanced Trivial FTP server, $ATFTP_BIN is not installed." # Tell the user this has skipped rc_status -s exit 5 fi -# Set default in case of missing sysconfig file -ATFTPD_USE_INETD=yes -ATFTPD_OPTIONS="" -if [ -f /etc/sysconfig/atftpd ]; then - . /etc/sysconfig/atftpd -fi +ATFTP_LOG_FILE="/var/log/atftpd/atftp.log" +ATFTP_LOG_DIR="$(dirname ${ATFTP_LOG_FILE})" +ATFTP_PID_DIR="/var/run/atftpd" + +# check for sysconfig file +[ -f /etc/sysconfig/atftpd ] && . /etc/sysconfig/atftpd -if [ "$ATFTPD_USE_INETD" = "yes" ]; then - exit 0; +# Set default in case of missing sysconfig file +ATFTP_USR=${ATFTPD_USER:="tftp"} +ATFTP_GRP=${ATFTPD_GROUP:="tftp"} +ATFTP_OPTS=${ATFTPD_OPTIONS:=""} +ATFTP_USE_INETD=${ATFTPD_USE_INETD:="no"} +ATFTP_DIR=${ATFTPD_DIRECTORY:="/srv/tftpboot"} +ATFTP_BIND=${ATFTP_BIND_ADDRESSES:=""} + +# start as daemon with some default opts +ATFTP_DEF_OPTS="--daemon --user $ATFTP_USR --group $ATFTP_GRP --logfile $ATFTP_LOG_FILE" + +# set correct perm on log_dir/pid_dir +# IN: $ATFTP_USR +set_perm(){ + [ ! -f "$ATFTP_LOG_FILE" ] && touch "$ATFTP_LOG_FILE"; + chown -R ${1}:root "$ATFTP_LOG_DIR" + [ ! -d "$ATFTP_PID_DIR" ] && /usr/bin/install -d "$ATFTP_PID_DIR"; + chown -R ${1}:root "$ATFTP_PID_DIR" +} + +if [ "$ATFTP_USE_INETD" = "yes" ]; then + echo "ATFTP is set to start via inetd" + exit 0; fi case "$1" in start) - if [ -n "$ATFTPD_BIND_ADDRESSES" ]; then - for IP in $ATFTPD_BIND_ADDRESSES; do - echo -n "Starting Advanced Trivial FTP server on $IP" - startproc -p "/var/run/atftpd/$IP.pid" -f $ATFTPD_BIN --pidfile "/var/run/atftpd/$IP.pid" $ATFTPD_OPTIONS $ATFTPD_DIRECTORY --bind-address $IP - rc_status -v - done + set_perm "${ATFTP_USR}" + if [ -n "$ATFTP_BIND" ]; then + for IP in $ATFTP_BIND; do + echo -n "Starting Advanced Trivial FTP server on $IP: " + ## Start daemon with startproc(8). If this fails + ## the echo return value is set appropriate. + startproc -p "${ATFTP_PID_DIR}/$IP.pid" -f $ATFTP_BIN --pidfile "${ATFTP_PID_DIR}/$IP.pid" $ATFTP_DEF_OPTS $ATFTP_OPTS $ATFTP_DIR --bind-address $IP + + # Remember status and be verbose + rc_status -v + done else - echo -n "Starting Advanced Trivial FTP server" - startproc $ATFTPD_BIN --pidfile "/var/run/atftpd/pid" $ATFTPD_OPTIONS $ATFTPD_DIRECTORY + echo -n "Starting Advanced Trivial FTP server: " + ## Start daemon with startproc(8). If this fails + ## the echo return value is set appropriate. + startproc $ATFTP_BIN --pidfile "${ATFTP_PID_DIR}/pid" $ATFTP_DEF_OPTS $ATFTP_OPTS $ATFTP_DIR + + # Remember status and be verbose rc_status -v fi ;; stop) - echo -n "Stopping Advanced Trivial FTP server" - killproc -TERM $ATFTPD_BIN - rc_status -v + echo -n "Stopping Advanced Trivial FTP server: " + killproc -TERM $ATFTP_BIN # Remember status and be verbose -# rc_status -v + rc_status -v ;; try-restart) ## Do a restart only if the service was active before. @@ -105,8 +135,39 @@ # Remember status and be quiet rc_status ;; + force-reload) + #echo -n "Reloading Advanced Trivial FTP server: " + ## if it supports it: + #/sbin/killproc -HUP $ATFTP_BIN + #touch /var/run/FOO.pid + + # Remember status and be verbose + #rc_status -v + + ## Otherwise: + $0 try-restart + #rc_status + ;; + reload) + echo -n "Reloading Advanced Trivial FTP server: " + ## Like force-reload, but if daemon does not support + ## signaling, do nothing (!) + + # If it supports signaling: + #/sbin/killproc -HUP $ATFTP_BIN + #touch /var/run/FOO.pid + + # Remember status and be verbose + #rc_status -v + + ## Otherwise if it does not support reload: + rc_failed 5 + + # Remember status and be verbose + rc_status -v + ;; status) - echo -n "Checking for service atftp:" + echo -n "Checking for Advanced Trivial FTP server: " ## Check status with checkproc(8), if process is running ## checkproc will return with exit status 0. @@ -117,11 +178,13 @@ # 3 - service not running # NOTE: checkproc returns LSB compliant status values. - checkproc $ATFTPD_BIN + checkproc $ATFTP_BIN + + # Remember status and be verbose rc_status -v ;; *) - echo "Usage: $0 {start|stop|status|try-restart|restart}" + echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}" exit 1 ;; esac ++++++ atftpd.logrotate ++++++ /var/log/atftpd/atftp.log { compress dateext maxage 365 rotate 99 size=+4096k notifempty missingok create 640 tftp tftp postrotate /etc/init.d/atftpd restart endscript } ++++++ atftpd.sysconfig ++++++ --- /var/tmp/diff_new_pack.iFPqFN/_old 2011-01-18 12:16:26.000000000 +0100 +++ /var/tmp/diff_new_pack.iFPqFN/_new 2011-01-18 12:16:26.000000000 +0100 @@ -1,11 +1,31 @@ ## Path: Network/FTP/Atftpd ## Description: ATFTP Configuration ## Type: string -## Default: "--daemon " +## Default: "tftp" +# +# daemon user (tftp) +# +ATFTPD_USER="tftp" + +## Type: string +## Default: "tftp" +# +# daemon user (tftp) +# +ATFTPD_GROUP="tftp" + +## Type: string +## Default: "" +## +## INFO: +## "--daemon, --user, --group, --logfile" can not be removed/replaced here as +## atftp is started with them as default opts: "--daemon --user atftp --group atftp " +## and +## logging to file is set as default: "--logfile /var/log/atftpd/atftp.log " # # atftpd options # -ATFTPD_OPTIONS="--daemon " +ATFTPD_OPTIONS="" ## Type: yesno ## Default: no @@ -15,12 +35,14 @@ ATFTPD_USE_INETD="no" ## Type: string -## Default: "/tftpboot" +## Default: "/srv/tftpboot" +## was "/tftpboot" but +## "/tftpboot" is not allowed anymore in FHS 2.2. # # TFTP directory must be a world readable/writable directory. -# By default /tftpboot is assumed. +# By default /srv/tftpboot is assumed. # -ATFTPD_DIRECTORY="/tftpboot" +ATFTPD_DIRECTORY="/srv/tftpboot" ## Type: string ## Default: "" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org