You are not logged in.

#1 2005-11-14 15:46:52

peque
Member
From: Denmark - Møn
Registered: 2005-06-26
Posts: 441

Create a deamon

Is it possible to create a deamon for resin and how...

I have follow the guides by resin , but that doesen´t work????

What is the sript in rc.d called by filetype ??? resin.sh

Then when I look into rc.d I doesent look like the others deamon???

So how do I do that instead of manual starting the resin webserver each its reboots ????


THX


Just getting better .... All the time

Offline

#2 2005-11-14 16:03:07

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Create a deamon

You should probably write your own script much like the existing daemons in /etc/rc.d/, but follow the setup for the one that comes with resin (the one with resin is probably a SysV style initscript).

Offline

#3 2005-11-14 17:24:25

peque
Member
From: Denmark - Møn
Registered: 2005-06-26
Posts: 441

Re: Create a deamon

I have follow the one....

But it´s not workin... I hvae made a scrit called resin.sh with following :
(this is the standart - i have put in the correct dir instead.

#!/bin/sh

JAVA_HOME=/usr/java   
RESIN_HOME=/usr/local/resin
SERVER_ROOT=/usr/local/web

export JAVA_HOME
export RESIN_HOME
export SERVER_ROOT

$RESIN_HOME/bin/httpd.sh


Just getting better .... All the time

Offline

#4 2005-11-14 17:35:42

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Create a deamon

That looks like a /etc/profile.d script, not an /etc/rc.d script. It sets up variables for the home, but it doesn't start a network or anything.

Dusty

Offline

#5 2005-11-14 18:18:21

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Create a deamon

Peque wrote:

But it´s not workin...

That means nothing to me.

read: /dev/your_mind: No such file or directory

What doesn't work? What are the error messages? What have you tried? What evidence do you have that it's not working?

Offline

#6 2005-11-14 20:00:45

CyberTron
Member
From: Gotland ,Sweden
Registered: 2005-03-17
Posts: 645
Website

Re: Create a deamon

Dusty wrote:

That looks like a /etc/profile.d script, not an /etc/rc.d script. It sets up variables for the home, but it doesn't start a network or anything.

Dusty

Agreed,
just put that script in /etc/profile.d  and make it executable and t should work, another solution is to put the (or a path to the code) in rc.local


http://www.linuxportalen.com  -> Linux Help portal for Linux and ArchLinux (in swedish)

Dell Inspiron 8500
Kernel 2.6.14-archck1  (selfcompiled)
Enlightenment 17

Offline

#7 2005-11-15 07:40:21

peque
Member
From: Denmark - Møn
Registered: 2005-06-26
Posts: 441

Re: Create a deamon

Think I got the answer other ways around

But thanks anyway  everybody...

The thing i wanted to do, was creating a deamon that starts resin at boot time.. thats it ?


Just getting better .... All the time

Offline

#8 2005-11-15 12:23:10

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Create a deamon

Yeah, we got that - speaking for myself, though, I was never sure from your posts what exactly you had tried to do, and what was not working.

Glad you got the answer, anyway.

Offline

#9 2005-11-16 10:46:56

peque
Member
From: Denmark - Møn
Registered: 2005-06-26
Posts: 441

Re: Create a deamon

Its was how to create the deamon...I´m not into how to make the scripts and I did try the way Resin explain it - but that didn´t work..

so here is what the solution was:

in rc.local/resin.sh

RESIN_HOME=/opt/resin

export RESIN_HOME

And then make a script and put in /etc/rc.d called resind

#!/bin/bash
#
# RESIND - Resin Http Server Daemon
#
# Autor: S.M. Masi:x
# Date:  15.11.2005.
# Version 1.1 M:X
#
. /etc/rc.conf
. /etc/rc.d/functions
. /etc/profile.d/resin.sh
. /etc/profile.d/j2sdk.sh

case "$1" in
  start)
      stat_busy "Starting Resin web server"
      $RESIN_HOME/bin/httpd.sh start &> /dev/null
      if [ $? -gt 0 ]; then
        stat_fail
      else
        rm_daemon resin
        stat_done
      fi
    ;;
  stop)
      stat_busy "Stopping Resin web server"
      $RESIN_HOME/bin/httpd.sh stop &> /dev/null
      if [ $? -gt 0 ]; then
        stat_fail
      else
        rm_daemon resin
        stat_done
      fi
    ;;
  restart)
    $0 stop
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}" 
esac
exit 0


The script is from a friend from school - so THX MASI

hope others can use it...


Just getting better .... All the time

Offline

#10 2005-11-16 11:58:04

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Create a deamon

In the start) section, you should have add_daemon, not rm_daemon. Have a look at some of the other scripts in /etc/rc.d for guidance.

Offline

Board footer

Powered by FluxBB