You are not logged in.

#1 2006-07-17 08:13:58

Bob Day
Member
Registered: 2005-11-26
Posts: 43

[request] kissd: a lightweight KiSS PC-Link Daemon

kissd: a lightweight KiSS PC-Link Daemon

http://www.popies.net/kissd/index.html

This one would be easily to install, if it would not use kissd.init to start the deamon

anyone knows how to create a PKGBUILD for kissd together with correct rc.d file?

Offline

#2 2006-07-22 20:27:56

Bob Day
Member
Registered: 2005-11-26
Posts: 43

Re: [request] kissd: a lightweight KiSS PC-Link Daemon

I gave it a try myself, only problem is that my /etc/rc.d/kissd works, but not how it is suppost to work:

# /etc/rc.d/kissd start
:: Starting KiSS Daemon                                                  [BUSY] 
starting kissd...
shutting down kissd...
                                                                         [DONE]

anyone knows how to fix this?

WARNING: This is not proper working yet!

here are my PKGBUILD and /etc/rc.d/kissd:

PKGBUILD

pkgname=kissd
pkgver=0.11
pkgrel=1       
pkgdesc="Lightweight KiSS PC-Link Daemon"
depends=()
source=(http://www.popies.net/kissd/$pkgname-$pkgver.tar.bz2)
md5sums=('99b0bceb6e7a1aa0a8037be1b0b1b46c')
url="http://www.popies.net/kissd/index.html"

build() {
  cd $startdir/src/$pkgname-$pkgver
  install -D -o root -g root -m 755 kissd-pretrigger $startdir/pkg/usr/bin/kissd-pretrigger
  install -D -o root -g root -m 755 kissd-posttrigger $startdir/pkg/usr/bin/kissd-posttrigger
  sed -i 's/install/install -D/g' Makefile
  make || return 1
  make DESTDIR=$startdir/pkg install
  install -D -o root -g root -m 755 $startdir/kissd $startdir/pkg/etc/rc.d/kissd
}

/etc/rc.d/kissd

#!/bin/bash

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

PID=`cat /var/run/kissd.pid 2>/dev/null`
case "$1" in
  start)
    stat_busy "Starting KiSS Daemon"
    [ -z "$PID" ] && /usr/sbin/kissd
    if [ $? -gt 0 ]; then
      stat_fail
    else
      add_daemon kissd -dk
      stat_done
    fi
    ;;
  stop)
    stat_busy "Stopping KiSS Daemon"
    [ ! -z "$PID" ]  && kill $PID &> /dev/null
    if [ $? -gt 0 ]; then
      stat_fail
    else
      rm_daemon sshd
      stat_done
    fi
    ;;
  restart)
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"
esac
exit 0

[ moderators....perhaps this topic shoul be moved to `Making Packages` now ]

Offline

#3 2006-07-22 21:09:25

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: [request] kissd: a lightweight KiSS PC-Link Daemon

You'll need to add kissd in the source array and install it with

  install -D -o root -g root -m 755 $startdir/src/kissd $startdir/pkg/etc/rc.d/kissd

More seriously your sript has several errorsn namely in the add_daemon and rm_daemon lines. Here's a fixed one:

#!/bin/bash

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

PID=`cat /var/run/kissd.pid 2>/dev/null`
case "$1" in
  start)
    stat_busy "Starting KiSS Daemon"
    [ -z "$PID" ] && /usr/sbin/kissd -dk
    if [ $? -gt 0 ]; then
      stat_fail
    else
      add_daemon kissd
      stat_done
    fi
    ;;
  stop)
    stat_busy "Stopping KiSS Daemon"
    [ ! -z "$PID" ]  && kill $PID &> /dev/null
    if [ $? -gt 0 ]; then
      stat_fail
    else
      rm_daemon kissd
      stat_done
    fi
    ;;
  restart)
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"
esac
exit 0

I haven't tried the package. Let me know how it works.

Offline

#4 2006-07-22 21:24:59

Bob Day
Member
Registered: 2005-11-26
Posts: 43

Re: [request] kissd: a lightweight KiSS PC-Link Daemon

Thanks for the corrections Snowman.
Starting the daemon goes good now, stopping fails.

Below my updated PKGBUILD:

PKGBUILD

pkgname=kissd
pkgver=0.11
pkgrel=1
pkgdesc="Lightweight KiSS PC-Link Daemon"
depends=()
source=(http://www.popies.net/kissd/$pkgname-$pkgver.tar.bz2 kissd)
md5sums=('99b0bceb6e7a1aa0a8037be1b0b1b46c' '2ddab2f221d4202e027dcd4c9be1415c')
url="http://www.popies.net/kissd/index.html"

build() {
  cd $startdir/src/$pkgname-$pkgver
  install -D -o root -g root -m 755 kissd-pretrigger $startdir/pkg/usr/bin/kissd-pretrigger
  install -D -o root -g root -m 755 kissd-posttrigger $startdir/pkg/usr/bin/kissd-posttrigger
  sed -i 's/install/install -D/g' Makefile
  make || return 1
  make DESTDIR=$startdir/pkg install
  install -D -o root -g root -m 755 $startdir/src/kissd $startdir/pkg/etc/rc.d/kissd
}

EDIT: I think I know what the problem is.
No pid file is created during startup, that's why it can't be stopped with the pid...I haven't found out how to solve it though

Offline

#5 2006-07-22 21:42:49

Bob Day
Member
Registered: 2005-11-26
Posts: 43

Re: [request] kissd: a lightweight KiSS PC-Link Daemon

also found a solution for stopping the deamon:

#!/bin/bash

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

PID=`pidof -o %PPID /usr/sbin/kissd`
case "$1" in
  start)
    stat_busy "Starting KiSS Daemon"
    [ -z "$PID" ] && /usr/sbin/kissd -dk
    if [ $? -gt 0 ]; then
      stat_fail
    else
      add_daemon kissd
      stat_done
    fi
    ;;
  stop)
    stat_busy "Stopping KiSS Daemon"
    [ ! -z "$PID" ]  && kill $PID &> /dev/null
    if [ $? -gt 0 ]; then
      stat_fail
    else
      rm_daemon kissd
      stat_done
    fi
    ;;
  restart)
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"
esac
exit 0

Offline

Board footer

Powered by FluxBB