LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-28-2009, 10:58 AM   #1
Ness_Wiggin
LQ Newbie
 
Registered: Apr 2005
Posts: 2

Rep: Reputation: 0
Configure an application to run as a daemon in Fedora 12


I have recently installed Verlihub (a DC++ hub server) on Fedora 12. The install went fine and I can manually launch the service fine but I would like to configure it to run as a daemon. By this I mean I would like to be able to launch it with "#service verlihub start" or configure it to start automatically when the server starts up without having to log in as a user and launch it. The Verlihub website has directions to do this on Gentoo but it hasn't translated over to Fedora well for me. This is the init.d script provided on the Verlihub website.
Code:
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

# Verlihub boot script for gentoo distributions

depend() {
        need net
        need mysql
}

start() {
        ebegin "Starting verlihub"

        # make sure the configuration directory exists
        if [[|! -d ${CONFDIR} ]]; then
                eerror FATAL ERROR: missing configuration directory ${CONFDIR}
                return 1
        fi;

        # check for the required files
        for f in ${REQFILES}; do
                file=${CONFDIR}/$f

                if [[|! -e $file ]]; then
                        eerror "FATAL ERROR: missing required file $file"
                        return 1
                fi;
        done;

        # check for the optional files
        for f in ${OPTFILES}; do
                file=${CONFDIR}/$f
                if [[|! -e $file ]]; then
                        eerror "WARNING: missing file $file, some functionality will be disabled"
                fi;
        done;

        # start the hub
        start-stop-daemon --start --quiet --background --make-pidfile --pidfile ${VERLIPIDFILE} --exec ${VERLIBIN}

        eend $?
}

stop () {
        ebegin "Stopping verlihub"

        # stop verlihub
        start-stop-daemon --stop --pidfile ${VERLIPIDFILE}

        eend $?
}
I am not super new to Linux, but other than trying to change the first line to !/bin/bash I am at a bit of a loss here. When I try running it, the system gets hung up on the syntax of line 16:

Code:
if [[|! -d ${CONFDIR} ]]; then
The Verlihub site also has code to put into /etc/conf.d but I have no such directory and I'm not sure that making it is the correct step.

I have played around in /etc/init.d as well as /etc/rc.local per suggestions I found searching online, but I still cannot seem to get it to work.

I understand that writing a full blown script to make the application work totally as a daemon may be out of the scope of possibility for now so even a solution to have the application launch as root when the computer boots would be helpful.

Any suggested directions would be greatly appreciated. Thanks in advance.
 
Old 11-28-2009, 05:53 PM   #2
Ness_Wiggin
LQ Newbie
 
Registered: Apr 2005
Posts: 2

Original Poster
Rep: Reputation: 0
Update

I was able to get the service to start automatically by adding the correct line to /etc/rc.local. I had tried this before but it turns out the reason it wasn't working is because I had a typo in my file path. It still doesn't operate like a normal service but it will work for my needs.
 
Old 11-29-2009, 11:50 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,360

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Just copy a normal Fedora service script and amend that.
 
  


Reply



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
How to run JBoss 5 as a Service / Daemon on Fedora 8? socal_javaguy Linux - Software 1 07-31-2009 11:30 AM
Enable daemon to run with service daemon start,etc baddah Programming 6 12-02-2007 05:51 PM
How to install and run application in fedora? Jowee Linux - Software 2 08-24-2007 10:45 AM
how to install, configure, run alcatel speedtouch 330 usb adsl modem on fedora core 4 shang3000 Linux - Networking 0 08-02-2006 05:14 PM
can a rdhat8 application run on fedora/enterprise? sharki Linux - Software 3 01-13-2005 12:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:17 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration