From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-Id: <200204161211.RAA07109@ns.esoo.ru> Content-Type: text/plain; charset="koi8-r" From: vic ismakaev Organization: esoo To: mandrake-russian@altlinux.ru X-Mailer: KMail [version 1.3.2] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [mdk-re] Custom initscript Sender: mandrake-russian-admin@altlinux.ru Errors-To: mandrake-russian-admin@altlinux.ru X-BeenThere: mandrake-russian@altlinux.ru X-Mailman-Version: 2.0 Precedence: bulk Reply-To: mandrake-russian@altlinux.ru X-Reply-To: viclists@mail.esoo.ru List-Help: List-Post: List-Subscribe: , List-Id: Linux-Mandrake RE / ALT Linux discussion list List-Unsubscribe: , List-Archive: Date: Tue Apr 16 16:12:36 2002 X-Original-Date: Tue, 16 Apr 2002 18:11:47 +0600 Archived-At: List-Archive: List-Post: Очередная проблема: Создал 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 # # # Source function library. . /etc/init.d/functions # SourceIfNotEmpty /etc/sysconfig/network && [ "$NETWORKING" != no ] || exit # 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 : " killproc -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 -- С уважением Виктор В Исмакаев