]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Improving receiver and sorter start using script mailleur
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Thu, 26 Jun 2025 20:45:37 +0000 (16:45 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Thu, 26 Jun 2025 20:45:37 +0000 (16:45 -0400)
linux/osukiss/mailleur [new file with mode: 0644]
linux/osukiss/receiver
linux/osukiss/sorter
mailleur.spec.in

diff --git a/linux/osukiss/mailleur b/linux/osukiss/mailleur
new file mode 100644 (file)
index 0000000..f1344a6
--- /dev/null
@@ -0,0 +1,57 @@
+#!/bin/sh
+#=================================================================
+# Begin receiver
+#
+# Description : Start mailleur receiver daemon
+# chkconfig: 2345 94 12
+#
+#=================================================================
+
+### BEGIN INIT INFO
+# Provides:            $mailler
+# Required-Start:      $network $dovecot
+# Should-Start:
+# Required-Stop:       sendsignals
+# Should-Stop:
+# Default-Start:       3 4 5
+# Default-Stop:        0 1 2 6
+# Short-Description:   Starts mailleur reciever and sorter  daemon.
+# Description:         Starts mailleur needed daemon.
+# X-LFS-Provided-By:   LFS
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+APPNAME=mailleur
+DAEMON=receiver
+DAEMON_PID=/run/${APPNAME}/${DAEMON}.lock
+
+# Some functions to make the below more readable
+
+#loading load configuration file
+if [ -f  /etc/sysconfig/$APPNAME ] ; then
+  . /etc/sysconfig/$APPNAME
+fi
+
+#--------------------------------------------------------------
+#to start all mailleur daemon
+#--------------------------------------------------------------
+case "$1" in
+      condrestart      \
+      reload           \
+      restart          \
+      start            \
+    | stop             \
+    )
+       /usr/share/$APPNAME/linux/osukiss/receiver $1
+       /usr/share/$APPNAME/linux/osukiss/sorter $1
+        ;;
+
+    *)
+        echo "Usage: $0 {start|stop|reload|condrestart|restart}"
+        exit 1
+        ;;
+esac
+
+
+
index ba02d7449ef3ad6c0f69e2dbb4b87b0aa16dbe5f..9c958cc29edc13684b2c0f204aa00cb2ed0f07ae 100644 (file)
@@ -34,7 +34,7 @@ if [ -f  /etc/sysconfig/$APPNAME ] ; then
 fi
 
 #--------------------------------------------------------------
-#to start clement daemon
+#to start receiver daemon
 #--------------------------------------------------------------
 mng_daemon ()
 
@@ -97,7 +97,7 @@ case "$1" in
 
 
     *)
-        echo "Usage: $0 {start|stop|reload|restart|status}"
+        echo "Usage: $0 {start|stop|reload|restart}"
         exit 1
         ;;
 esac
index 1f2bea29dd95ef6fe37cf873426532211beb92fb..122b1f50476e67db32f3733f08f8c3432b87d497 100644 (file)
@@ -34,7 +34,7 @@ if [ -f  /etc/sysconfig/$APPNAME ] ; then
 fi
 
 #--------------------------------------------------------------
-#to start clement daemon
+#to start sorter daemon
 #--------------------------------------------------------------
 mng_daemon ()
 
index 3562422dfab31cbd254c218d887f54a0a1b8ee2a..ff2877ce98449cd316656d3dbf5ac950382305bd 100644 (file)
@@ -34,8 +34,9 @@ search about email exchange within time and transaction context.
 #-----------------------------------------------------------------------------
 %files                 
 %defattr(-,root,root,-)
-%attr(0755,root,root) %{_datadir}/%{name}/linux/osukiss/receiver
-%attr(0755,root,root) %{_datadir}/%{name}/linux/osukiss/sorter
+%attr(0754,root,root) %{_datadir}/%{name}/linux/osukiss/%{name}
+%attr(0754,root,root) %{_datadir}/%{name}/linux/osukiss/receiver
+%attr(0754,root,root) %{_datadir}/%{name}/linux/osukiss/sorter
 %attr(0644,%{name},mail) %config(noreplace) %{_sysconfdir}/pki/%{name}/*
 %attr(0644,%{name},mail) %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
 %attr(0644,%{name},mail) %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
@@ -67,7 +68,7 @@ if [ "$1" = 0 ]; then
   case "$OS" in
     "sysv"     |                               \
     "osukiss"  )
-      for action in receiver sorter
+      for action in %{name}
        do
         %{_initrddir}/${action} stop > /dev/null 2>&1 || :
         %{_sbindir}/chkconfig --del ${action} 
@@ -118,7 +119,7 @@ if [ "$1" = 1 ]; then
   case "$OS" in
     "sysv"     |                                       \
     "osukiss"  )
-      for action in receiver sorter
+      for action in %{name}
        do
         %{__ln_s}                                      \
                %{_datadir}/%{name}/linux/$OS/${action} \
@@ -134,7 +135,7 @@ if [ "$1" = 1 ]; then
 case "$OS" in
   "sysv"       |                                       \
   "osukiss"    )
-    for action in receiver sorter
+    for action in %{name}
       do
       %{_sbindir}/chkconfig --add ${action}
       %{_sysconfdir}/rc.d/init.d/${action} condrestart > /dev/null 2>&1 || :
@@ -185,8 +186,7 @@ if [ "$1" = 1 ]; then
 
 %postun                        postgresql
 if [ "$1" = 0 ]; then
-  rm -f %{_sbindir}/receiver
-  rm -f %{_sbindir}/sender
+  rm -f %{_sbindir}/%{name}
   fi
 
 #=============================================================================