Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37038437
en ru br
Репозитории ALT

Группа :: Система/Серверы
Пакет: 389-ds-base

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: alt-fix-initscripts.patch
Скачать


index 7601784..f96cb82 100644
--- a/wrappers/initscript.in
+++ b/wrappers/initscript.in
@@ -361,8 +361,11 @@ case "$1" in
     condrestart)
         [ ! -f $lockfile ] || restart
         ;;
+    condstop)
+        [ -f $lockfile ] && stop || :
+	;;
     *)
         echo Unknown command $1
-        echo "Usage: $0 {start|stop|status|restart|condrestart} [instance-name]"
+        echo "Usage: $0 {start|stop|status|restart|condrestart|condstop} [instance-name]"
         exit 2
 esac
diff --git a/wrappers/ldap-agent-initscript.in b/wrappers/ldap-agent-initscript.in
index dd8ee97..104dd87 100644
--- a/wrappers/ldap-agent-initscript.in
+++ b/wrappers/ldap-agent-initscript.in
@@ -206,6 +206,16 @@ condrestart() {
     fi
 }
 
+condstop() {
+    if [ -f $pidfile ]; then
+        pid=`cat $pidfile`
+        name=`ps -p $pid | tail -1 | awk '{ print $4 }'`
+        if kill -0 $pid && [ $name = "$processname" ]; then
+            stop
+        fi
+    fi
+}
+
 status() {
      ret=0
      if [ -f $pidfile ]; then
@@ -225,7 +235,7 @@ status() {
 
 
 case "$1" in
-    start|stop|restart|reload|condrestart|status)
+    start|stop|restart|reload|condrestart|condstop|status)
         $1
         ;;
     *)
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin