ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
* [sisyphus] ez-ipupdate: критика
@ 2004-05-29 18:27 Yura Zotov
  2004-05-31 18:43 ` [sisyphus] " Michael Shigorin
  2004-06-01 13:43 ` [sisyphus] " sergey ivanov
  0 siblings, 2 replies; 4+ messages in thread
From: Yura Zotov @ 2004-05-29 18:27 UTC (permalink / raw)
  To: Sisyphus List

[-- Attachment #1: Type: text/plain, Size: 650 bytes --]

Обнаружил, что инитскрипт для ez-ipupdate срабатывает с ошибками.
Разборки выявили как банальные опечатки, так и более
принципиальные недочёты. На основе этого скрипта и
/etc/init.d/template я написал новый скрипт, который работает как
положено. Он прицеплен. Предлагаю включить в пакет ez-ipupdate
новый скрипт вместо старого.

P.S. Не совсем понял, какой смысл в выделении файла
ez-ipupdate.pid в отдельный каталог /var/run/ez-ipupdate/.
По-моему его было бы правильнее держать вместе с остальными
pid-файлами в /var/run/. Ведь с lock-файлом вы (обращение к
мантейнеру пакета) так и поступали, оставляя его в
/var/lock/subsys/.


--
Юрий А. Зотов


[-- Attachment #2: ez-ipupdate --]
[-- Type: text/plain, Size: 1952 bytes --]

#!/bin/sh
#
# ez-ipupdate     Starts and stops the ez-ipupdate daemon
#
# chkconfig: - 55 45
#
# processname: ez-ipupdate
# description: Check and update your IP to dynamic DNS Server.
# pidfile: /var/run/ez-ipupdate/ez-ipudpate.pid
# config: /etc/ez-ipupdate.conf

EZ_CONFIG=/etc/ez-ipupdate.conf
EZ_BIN=/usr/sbin/ez-ipupdate
EZ_PID=/var/run/ez-ipupdate/ez-ipupdate.pid
PROG=ez-ipupdate
LOCKFILE="/var/lock/subsys/$PROG"

# Make sure relevant files exist
[ -x "$EZ_BIN" -a -s "$EZ_CONFIG" ] || exit 0

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0

RETVAL=0

start() {
    # Start daemons.
    start_daemon --pidfile "$EZ_PID" --lockfile "$LOCKFILE" -- "$EZ_BIN" --daemon --config-file "$EZ_CONFIG" --pid-file "$EZ_PID"
	RETVAL=$?
	return $RETVAL
}

stop() {
    # Stop daemons.
	stop_daemon --pidfile "$EZ_PID" --lockfile "$LOCKFILE" -- "$PROG"
    RETVAL=$?
	return $RETVAL
}

reload() {
    # Reload config by sending a SIGHUP.
    msg_reloading "$PROG"
    stop_daemon --pidfile "$EZ_PID" -HUP -- "$PROG"
    RETVAL=$?
    echo
}

restart() {
    stop
    start
    RETVAL=$?
}

# See how we were called.
case "$1" in
	start)
  		start
  		;;
	stop)
  		stop
  		;;
	restart)
  		restart
  		;;
	reload)
  		reload
  		;;
	condstop)
		if [ -e "$LOCKFILE" ]; then
			stop
		fi
		;;
	condrestart)
		if [ -e "$LOCKFILE" ]; then
			restart
		fi
		;;
	condreload)
		if [ -e "$LOCKFILE" ]; then
			reload
		fi
		;;
	status)
  		status --pidfile $EZ_PID $PROG
  		RETVAL=$?
  		if [ -r $EZ_CONFIG ]; then
    		ez_cache=`grep -E '^[[:space:]]*cache-file' $EZ_CONFIG | cut -d "=" -f2`
    		[ -n "$ez_cache" ] && \
      		echo "Last IP update: "`cat $ez_cache | cut -d "," -f2`
  		fi
  		;;
	*)
		msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}"
		RETVAL=1
esac

exit $RETVAL

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-06-01 13:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-29 18:27 [sisyphus] ez-ipupdate: критика Yura Zotov
2004-05-31 18:43 ` [sisyphus] " Michael Shigorin
2004-05-31 19:57   ` Yura Zotov
2004-06-01 13:43 ` [sisyphus] " sergey ivanov

ALT Linux Sisyphus discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
		sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
	public-inbox-index sisyphus

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sisyphus


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git