]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Adding init script receiver
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Mon, 16 Jun 2025 19:09:10 +0000 (15:09 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Mon, 16 Jun 2025 19:09:10 +0000 (15:09 -0400)
linux/osukiss/receiver [new file with mode: 0644]
mailleur.spec.in

diff --git a/linux/osukiss/receiver b/linux/osukiss/receiver
new file mode 100644 (file)
index 0000000..3d6242f
--- /dev/null
@@ -0,0 +1,104 @@
+#!/bin/sh
+#=================================================================
+# Begin receiver
+#
+# Description : Start mailleur sorter daemon
+# chkconfig: 2345 94 12
+#
+#=================================================================
+
+### BEGIN INIT INFO
+# Provides:            $reciever
+# Required-Start:      $sorter
+# Should-Start:
+# Required-Stop:       sendsignals
+# Should-Stop:
+# Default-Start:       3 4 5
+# Default-Stop:        0 1 2 6
+# Short-Description:   Starts reciever daemon.
+# Description:         Starts reciever daemon.
+# X-LFS-Provided-By:   LFS
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+APPNAME=mailleur
+DAEMON=reciever
+DAEMON_PID=/run/${DAEMON}.pid
+
+# Some functions to make the below more readable
+
+#loading load configuration file
+if [ -f  /etc/sysconfig/$APPNAME ] ; then
+  . /etc/sysconfig/$APPNAME
+fi
+
+#--------------------------------------------------------------
+#to start clement daemon
+#--------------------------------------------------------------
+mng_daemon ()
+
+{
+case "$1" in
+  start)
+    /usr/lib/$APPNAME/support/starting.sh osukiss
+    if [ $? != 0 ] ; then
+      exit 1;
+      fi
+    log_info_msg "Starting ${DAEMON} Server..."
+    start_daemon -f /usr/sbin/${DAEMON} $OPTIONS
+    evaluate_retval
+    ;;
+
+  stop)
+    log_info_msg "Stopping ${DAEMON} Server..."
+    killproc -p ${DAEMON_PID} /usr/sbin/${DAEMON}
+    evaluate_retval
+    rm -fr ${DAEMON_PID}
+    ;;
+
+ esac
+}
+
+case "$1" in
+      start    \
+    | stop     \
+    )
+       mng_daemon $1
+        ;;
+
+    reload)
+        log_info_msg "Reloading ${DAEMON} Server..."
+        pid=`cat ${DAEMON_PID} 2>/dev/null`
+
+        if [ -n "${pid}" ]; then
+           kill -HUP "${pid}"
+        else
+           (exit 1)
+        fi
+
+        evaluate_retval
+        ;;
+
+    restart)
+        $0 stop
+        sleep 1
+        $0 start
+        ;;
+
+    condrestart)
+        pid=`cat ${DAEMON_PID} 2>/dev/null`
+        if [ -n "${pid}"  -a -d /proc/$pid ]; then
+         $0 restart
+         fi
+        ;;
+
+
+    *)
+        echo "Usage: $0 {start|stop|reload|restart|status}"
+        exit 1
+        ;;
+esac
+
+
+
index aa67ca27664b0ec6c3d846d6a08eb7e513e9ce70..597c6cc6bf8e0269a31655147d6d3b0a811953cc 100644 (file)
@@ -30,6 +30,7 @@ search about email exchange within time and transaction context.
 %files                 
 %defattr(-,root,root,-)
 %attr(0644,%{name},mail) %config(noreplace) %{_sysconfdir}/%{name}/*
+%attr(0755,root,root) %{_datadir}/%{name}/linux/osukiss/receiver
 %attr(0755,root,root) %{_datadir}/%{name}/linux/osukiss/sorter
 %{_sbindir}/chkspf
 %{_sbindir}/receiver
@@ -37,7 +38,7 @@ search about email exchange within time and transaction context.
 %{_sbindir}/sorter
 %attr(0754,root,root) %{_libdir}/%{name}/shell/*.sh
 %attr(0754,root,root) %{_libdir}/%{name}/support/starting.sh
-%dir %{spooldir}/%{name}
+%dir %{spooldir}/%{name}/{queue,in.log,out.log}
 
 #-----------------------------------------------------------------------------
 
@@ -95,11 +96,10 @@ if [ "$1" = 1 ]; then
   echo "#------------------------------------------"
   ) >> %{_sysconfdir}/sysconfig/%{name}
   #installing init file according OS
-  echo JMPDBG
   case "$OS" in
     "sysv"     |                                       \
     "osukiss"  )
-      for action in sorter
+      for action in receiver sorter
        do
         %{__ln_s}                                      \
                %{_datadir}/%{name}/linux/$OS/${action} \
@@ -115,7 +115,7 @@ if [ "$1" = 1 ]; then
 case "$OS" in
   "sysv"       |                                       \
   "osukiss"    )
-    for action in sorter
+    for action in receiver sorter
       do
       %{_sbindir}/chkconfig --add ${action}
       %{_sysconfdir}/rc.d/init.d/${actions} condrestart > /dev/null 2>&1 || :