ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [mdk-re] Custom initscript
@ 2002-04-16 16:12 vic ismakaev
  2002-04-16 16:20 ` Vyt
  2002-04-16 16:23 ` [mdk-re] Custom initscript : вдогонку vic ismakaev
  0 siblings, 2 replies; 8+ messages in thread
From: vic ismakaev @ 2002-04-16 16:12 UTC (permalink / raw)
  To: mandrake-russian

Очередная проблема:
Создал initscript для cyrus-imap сервера,положил его в /etc/rc.d/init.d ,
но :
1)он не хочет регистрироватся по 
chkconfig --add cyrus
[root@devel1 init.d]# chkconfig --add cyrus
service cyrus does not support chkconfig

2) когда говорю
service cyrus start - не появляется сообщение [OK], хотя все нормально 
запускается и $RETVAL=0.
Причем service cyrus stop - все нормально и показывается [OK].

Файл ниже:

-----------------------------------------------------------
 #!/bin/sh
#
#	/etc/init.d/cyrus
#
#	Cyrus IMAP/POP3 daemon with virtual accounts of users
#	(implemented by SASL mechanism with PAM,LDAP,KERBEROS
#	authentification and authorization)
#	Provides: cyrus
#	Requires: network
#chkconfig:  2345 76 45
#
#	<tags -- see below for tag definitions.
#	*Every line* from the top of the file to the end of the tags section
#	must begin with a #	character. After the tags section, there should
#	be a blank line. This keeps normal comments in the rest of the file
#	from being mistaken for tags, should they happen to fit the pattern.>

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

#<source configuration/library files if required>
SourceIfNotEmpty /etc/sysconfig/network &&
        [ "$NETWORKING" != no ] ||
		        exit

#<define any local shell functions used by the code that follows>
CYRUS_BIN=/usr/cyrus/bin/master
test -x $CYRUS_BIN || exit

RETVAL=0
LOCKFILE=/var/lock/subsys/cyrus

start()
{
	echo -n "Starting cyrus: "
	# start daemons, perhaps with the daemon function, for example:
	daemon $CYRUS_BIN &
	RETVAL=$?
#	echo $RETVAL
	echo
	[ $RETVAL -eq 0 ] && touch "$LOCKFILE"
	return $RETVAL
}

stop()
{
	echo -n "Shutting down cyrus: "
	# stop daemons, perhaps with the killproc function, for example:
	killproc $CYRUS_BIN
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f "$LOCKFILE"
	return $RETVAL
}

restart()
{
	stop
	start
}

reload()
{
	# cause the service configuration to be reread, either with kill -HUP:
	echo -n "Reloading <servicename>: "
	killproc <servicename> -HUP
	RETVAL=$?
	echo
	# or by simple restarting the daemons in a manner similar to restart above.
}

# See how we were called.
case "$1" in
	start)
		start
		;;
	stop)
		stop
		;;
	reload)
		reload
		;;
	restart)
		restart
		;;
	condstop)
		# Stop the servce if it is already running, for example:
		if [ -e "$LOCKFILE" ]; then
			stop
		fi
		;;
	condrestart)
		# Restart the servce if it is already running, for example:
		if [ -e "$LOCKFILE" ]; then
			restart
		fi
		;;
	status)
		# report the status of the daemons in free-form format,
		# perhaps with the status function, for example:
		status cyrus
		RETVAL=$?
		;;
	probe)
		;;
		# optional. If it exists, then it should determine whether
		# or not the service needs to be restarted or reloaded (or
		# whatever) in order to activate any changes in the configuration
		# scripts. It should print out a list of commands to give to
		# $0; see also description of the probe tag.
	*)
		echo "Usage: ${0##*/} 
{start|stop|reload|restart|condstop|condrestart|status[|probe]}"
		RETVAL=1
esac

exit $RETVAL

-- 
С уважением
Виктор В Исмакаев



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

end of thread, other threads:[~2002-04-17 10:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-16 16:12 [mdk-re] Custom initscript vic ismakaev
2002-04-16 16:20 ` Vyt
2002-04-16 17:01   ` vic ismakaev
2002-04-16 20:13     ` Evgeniy Kobzev
2002-04-17  7:52       ` vic ismakaev
2002-04-17  9:36         ` Evgeniy Kobzev
2002-04-17 10:43           ` vic ismakaev
2002-04-16 16:23 ` [mdk-re] Custom initscript : вдогонку vic ismakaev

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/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 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

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


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