This project is read-only.

Windows

  1. Create a folder there the daemon should be installed, e.g. C:\Program Files\ARSoft.MultiRulePolicyDaemon
  2. Copy all files to that folder
  3. Change the Configuration to your needs
  4. Install the daemon by calling the exe-File this the parameter /install
  5. The daemon is now installed as service and you can start and stop it via ComputerManagement/Services

Ubuntu Linux

  1. Install the mono runtime and the package mono-2.0-service
  2. Create a user multipolicyd
  3. Create the folder /usr/share/ARSoft.MultiRulePolicyDaemon and ensure, that the user multipolicyd has read and write permissions to
  4. Copy all files to that folder
  5. Change the Configuration to your needs
  6. Create the init script /etc/init.d/multipolicyd:
    #!/bin/sh
    
    SERVICE_DRIVER=/usr/bin/mono-service2
    SERVICE_ASSEMBLY=/usr/share/ARSoft.MultiRulePolicyDaemon/ARSoft.MultiRulePolicyDaemon.exe
    SERVICE_USER=multipolicyd
    
    SERVICE_NAME=`basename $SERVICE_ASSEMBLY .exe`
    SERVICE_DIR=`dirname $SERVICE_ASSEMBLY`
    SERVICE_LOCK=/var/run/${SERVICE_NAME}.pid
    
    . /lib/lsb/init-functions
    
    case "$1" in
        start)
            log_daemon_msg "Starting Mono Service $SERVICE_NAME" "$SERVICE_NAME"
            if start-stop-daemon --start --quiet --oknodo --pidfile $SERVICE_LOCK --make-pidfi                                                                                                                                                   le --background --chuid $SERVICE_USER --startas $SERVICE_DRIVER -- -d:$SERVICE_DIR ${SERVI                                                                                                                                                   CE_NAME}.exe --no-daemon; then
                log_end_msg 0
            else
                log_end_msg 1
            fi
            ;;
        stop)
            log_daemon_msg "Shutting down Mono Service $SERVICE_NAME" "$SERVICE_NAME"
            if start-stop-daemon --stop --quiet --oknodo --pidfile $SERVICE_LOCK; then
                log_end_msg 0
            else
                log_end_msg 1
            fi
            ;;
        restart)
            $0 stop
            $0 start
            ;;
        status)
            status_of_proc -p $SERVICE_LOCK "" $SERVICE_NAME && exit 0 || exit $?
            ;;
        *)
            log_action_msg "Usage: $0 {start|stop|restart|status}"
            exit 1
            ;;
    esac
    1. Install the init-script with update-rc.d to enable automatic startup on system start

Last edited Oct 4, 2010 at 7:01 PM by AlexReinert, version 1

Comments

No comments yet.