Shellcmd (daemon) Blocking other Services



  • Hi,

    I admit, struggling to understand this one. I have a service (rc) file - works fine, details of the file as below,

    . /etc/rc.subr
    
    name=rateRRD
    rcvar="${name}_enable"
    load_rc_config $name
    
    command="/usr/sbin/daemon"
    command_args="-P /var/run/${name}.pid -r -t ${name} /usr/local/bin/${name}.py"
    pidfile="/var/run/${name}.pid"
    start_precmd="info Starting service ..."
    stop_postcmd="info Service has exited."
    
    run_rc_command "$1"
    

    By "works fine" I mean that if I run this from the shell (or ssh) it can be started, stopped, etc. But, if I try to run it from a shellcmd, it does start, but it blocks (some) other services from starting … which doesn't make any sense to me, as daemon should spawn this off (it does), so it should not be blocking (even if the .py file keeps running).

    Any thoughts?

    Thanks!



  • This is just a shot in the dark idea: have you tried appending "&" ?



  • Hi,

    I haven't for this command - as it runs daemon, automatically goes to the bg, no?

    But I did try some other commands, and put them in the bg - no joy … :(.

    Thanks!



  • I haven't for this command - as it runs daemon, automatically goes to the bg, no?

    Yeah I was thinking along the lines of: the sort of thing that shouldn't make a difference, but if you're getting desperate might be worth a try. And on the slim chance of it working, it would be a very interesting result.

    Good luck!



  • Appreciate the suggestion though - thanks!



  • OK, this is really odd … if I run this command as a shellcmd,

    service rateRRD start
    

    => it blocks the startup of other services. But, if I create a file inside /usr/local/etc/rc.d, named rateRRD.sh, and in that file …

    #!/bin/sh
    service rateRRD start
    
    

    This works perfectly! No blocking of other services or anything. So something not quite working right with shellcmd?

    Thanks!


Log in to reply