You are not logged in.

#1 2009-02-04 19:39:03

`dannyb
Member
From: /dev/null & aka Minnesota
Registered: 2009-01-27
Posts: 34

Tutorial for creating rc.d scripts?

Hello all I am new to the Arch Linux forums and have a relatively simple question (I think). I just downloaded and setup openfire on my archlinux server and would like to create an rc.d script for it so I can load it at startup and learn more about rc.d scripts in general. I was wondering if anybody has created an rc.d script for openfire? If not does a tutorial regarding the making of a typical rc.d script exist for archlinux?

Thank you,

Dan

Offline

#2 2009-02-04 20:20:02

pointone
Wiki Admin
From: Waterloo, ON
Registered: 2008-02-21
Posts: 379

Re: Tutorial for creating rc.d scripts?

I'm not aware of the existence of such a tutorial... but I know where you can find dozens of examples! Try looking through the existing scripts in /etc/rc.d; they really aren't that complicated.


M*cr*s*ft: Who needs quality when you have marketing?

Offline

#3 2009-02-04 20:22:02

`dannyb
Member
From: /dev/null & aka Minnesota
Registered: 2009-01-27
Posts: 34

Re: Tutorial for creating rc.d scripts?

Thank you pointone for the quick reply, I will do that and try to figure it out.

Offline

#4 2009-02-04 20:47:22

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: Tutorial for creating rc.d scripts?

i just wrote an rc.d script for dropbox; it took some fiddling but i finally got it working.  i used this.  there's an arch example at the end

for what it's worth here's the dropboxd script i finally got working wink

#!/bin/bash

PATH=/usr/sbin:/usr/bin:/sbin:/bin
DESC="Dropbox sharing service"
NAME=dropboxd
DAEMON=/home/patrick/.dropbox-dist/dropboxd
DAEMON_ARGS=""
PIDFILE=/var/run/$NAME.pid

. /etc/rc.conf
. /etc/rc.d/functions

case "$1" in
  start)
    stat_busy "Starting dropbox service..."
    $DAEMON &
    if [ $? -gt 0 ]; then
      stat_fail
    else
      add_daemon $NAME
      pidof $NAME > $PIDFILE
      stat_done
    fi
    ;;
  stop)
    stat_busy "Stopping dropbox service..."
    if [ -a $PIDFILE ]; then
      PID=`cat $PIDFILE`
      kill $PID > /dev/null
      if [ $? -gt 0 ]; then
        stat_fail
      else
        rm $PIDFILE
        rm_daemon $NAME
        stat_done
      fi
    else
      pkill $NAME
      if [ $? -gt 0 ]; then
        stat_fail
      else
        stat_done
      fi
    fi
    ;;
  restart|force-reload)
    $0 stop
    sleep 1
    $0 start
    ;;
esac
exit 0

Last edited by brisbin33 (2009-02-04 20:48:22)

Offline

#5 2009-02-04 20:47:44

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: Tutorial for creating rc.d scripts?


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#6 2009-02-04 20:50:48

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: Tutorial for creating rc.d scripts?

Also, abs package provides a proto version of an rc script which can be used as a template.  It's located in /usr/share/pacman/rc-script.proto.

Offline

#7 2009-02-04 20:53:30

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: Tutorial for creating rc.d scripts?

fwojciec --- you are 2 posts away from leet !!!


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#8 2009-02-04 21:00:59

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: Tutorial for creating rc.d scripts?

OK -- the next one is going to be my last post ever tongue

Offline

#9 2009-02-05 03:15:35

`dannyb
Member
From: /dev/null & aka Minnesota
Registered: 2009-01-27
Posts: 34

Re: Tutorial for creating rc.d scripts?

Guys I can't you enough for the help, I did some learning about how to build packages so it's worth a try for openfire smile Thank you so much guys this community is awesome!!

Offline

Board footer

Powered by FluxBB