ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: vic ismakaev <viclists@mail.esoo.ru>
To: mandrake-russian@altlinux.ru
Subject: [mdk-re] Custom initscript
Date: Tue Apr 16 16:12:36 2002
Message-ID: <200204161211.RAA07109@ns.esoo.ru> (raw)

Очередная проблема:
Создал 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

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



             reply	other threads:[~2002-04-16 16:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-16 16:12 vic ismakaev [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200204161211.RAA07109@ns.esoo.ru \
    --to=viclists@mail.esoo.ru \
    --cc=mandrake-russian@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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