LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 10-31-2008, 04:12 AM   #1
powadha
Member
 
Registered: Nov 2003
Distribution: Debian SID
Posts: 649

Rep: Reputation: 31
Using debian start-stop-daemon on Centos


I'm trying to install LLink (http://www.lundman.net/wiki/index.php/Llink) on Centos4 which makes use of the script below. I'm trying to get it running using these instructions http://www.lundman.net/wiki/index.ph...x_installation

Code:
#!/bin/sh

### BEGIN INIT INFO
# Provides:          llink
# Required-Start:    $network $local_fs $remote_fs
# Required-Stop:     $network $local_fs $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: start llink daemon
### END INIT INFO


# Defaults
RUN_MODE="daemons"

LLINKPID=/var/run/llink.pid
LLINK=/usr/local/bin/llink
LLINKOPTS="-f /usr/local/etc/llink/llink.conf -w /usr/local/etc/llink"

# clear conflicting settings from the environment
unset TMPDIR

# See if the daemons are there
test -x /usr/local/bin/llink || exit 0

. /lib/lsb/init-functions

case "$1" in
        start)
                log_daemon_msg "Starting llink daemons" "llink"

                if ! start-stop-daemon --start --quiet --exec $LLINK -- $LLINKOPTS ; then
                        log_end_msg 1
                        exit 1
                fi

                log_end_msg 0
                ;;
        stop)
                log_daemon_msg "Stopping llink daemons" "llink"

                start-stop-daemon --stop --quiet --oknodo --exec $LLINK -- $LLINKOPTS
                ;;
        reload|restart|force-reload)
                $0 stop
                sleep 1
                $0 start
                ;;
        *)
                echo "Usage: /etc/init.d/llink {start|stop|reload|restart|force-reload}"
                exit 1
                ;;
esac

exit 0
And needed to install the Debian start-stop-daemon on my Centos4 box. These are the steps I took to get it running on Centos:

I downloaded this tar archive:

http://developer.axis.com/download/d..._9_18-2.tar.gz
unpacked it
tar zxvf apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz
cd apps/sys-utils/start-stop-daemon-IR1_9_18-2/

gcc start-stop-daemon.c -o start-stop-daemon

Then I copied the newly created start-stop-daemon binary to /usr/sbin/

The result is hopefull, but I'm still getting some errors. I'd like to work out the last errors and get this thing to start up at boot (well, not sure if that's such a big point since the server is running 24/7 but it's good fun getting there).
These are the errors I'm still stuck with:

Code:
[root@gateway]# /etc/init.d/llink start
/etc/init.d/llink: line 30: log_daemon_msg: command not found
/usr/local/bin/llink - Jorgen Lundman v2.2.0 lundman@shinken.interq.or.jp build 1305 (Mon Oct 27 12:30:29 2008) (libdvdnav).

[main] ready!
/etc/init.d/llink: line 33: -f: command not found
/etc/init.d/llink: line 38: log_end_msg: command not found
[root@gateway]#
Shame that all this is so Debian while all my boxes run Debian except for the server (Centos). Any clues on how to get this fixed? Perhaps I should't use this script at all and go for a more Centos solution. Any comments on that are very welcome!

Regards
 
Old 11-02-2008, 05:59 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,987
Blog Entries: 54

Rep: Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742
Your SysV /etc/init.d/llink sources /lib/lsb/init-functions which may or may not exist (one doc, though Fedora: http://fedoraproject.org/wiki/FCNewInit/Initscripts). If you can't source functions like "log_daemon_msg" from elsewhere then at least you could add something like
Code:
log_daemon_msg() { logger "$@"; }
log_end_msg() { [ $1 -eq 0 ] && RES=OK; logger ${RES:=FAIL}; }
and change $LLINKOPTS to read "${LLINKOPTS}", though in RHEL/CentOS you usually want to source a /etc/sysconfig/llink and put options there (cleaner, easier managable).
 
  


Reply

Tags
centos, debian


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unexpected error messages with start-stop-daemon markseger Debian 3 10-29-2008 08:14 PM
start-stop-daemon for linux eliufoo Linux - Software 1 02-07-2008 02:12 AM
Debian "Start-Stop-Daemon" Notwerk Linux - Software 3 12-19-2005 03:16 AM
start-stop-daemon problems after process crash emarti20 Linux - Software 3 04-15-2005 08:54 AM
Logging with Start stop daemon bigsness Linux - General 0 01-19-2005 03:25 PM


All times are GMT -5. The time now is 12:47 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration