Find the answer to your Linux question:
Results 1 to 2 of 2
Hi everyone, I am having some problems getting a service to start properly on my Trixbox (CentOS 4.5 i think). The service is Asterfax and runs using java. I can ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2007
    Posts
    2

    Service start problem : Permission denied


    Hi everyone,

    I am having some problems getting a service to start properly on my Trixbox (CentOS 4.5 i think).

    The service is Asterfax and runs using java. I can start asterfax fine by using either the console file or the non console file. I am normally loged in as root when doing this (yes this is probably bad).

    Code:
    cd /usr/lib/asterfax/
    ./nohupasterfax.sh
    This runs the software fine.

    However, during installation it create a service startup in the init.d folder. This can be run from the terminal by the following...

    Code:
    service asterfax start
    This then outputs "./nohupasterfax.sh: line 26: iaxmodem: command not found" to the terminal, which is ok because it always displays this even when running it manually. After running it nothing appears in the "ps fax" list, but in the asterfax log path (/var/log/asterfax) a file exists which gets updated everytime i try to start the service. The file "error.out" contains the following error...

    nohup: cannot run command `java': Permission denied

    How do i fix this? I am a newbie when it comes to linux, but i have managed to get the trixbox/asterisk running fine.

    Oh, the contents of the asterfax file in "/etc/rc.d/init.d/" is...

    Code:
    #!/bin/sh
    case "$1" in
    	start)
    	    cd /usr/lib/asterfax
                ./nohupasterfax.sh
    	    ;;
    	
    	stop)
    	    cd /usr/lib/asterfax
                ./killasterfax.sh
    	    ;;
    	
    	restart)
    	    cd /usr/lib/asterfax
                ./killasterfax.sh
                nohupasterfax.sh
    	    ;;
    	*)
    	    echo $"Usage: $0 {start|stop|restart}"
    	    exit 1
    
    esac
    
    exit $RETVAL
    Please help, many thanks!

  2. #2
    Just Joined!
    Join Date
    Aug 2007
    Posts
    2
    Turns out that the java path is not set for whatever user is used when service is run. I modified the contents of the asterfax file in "/etc/rc.d/init.d/" and added a few "export" commands. That got it working. Dirty hack!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •