OpenWrt Forum Archive

Topic: uShare cannot autostart? but can be luanched from console

The content of this topic has been archived on 16 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

tried addto rc.local???doesn't work

i can now only activate ushare after loginto SSH with the following command:

/etc/init.d/ushare start

what is wrong?

my environment is the nowest snapshots Trunk version  (r30639)

weereew wrote:

tried addto rc.local???doesn't work

/etc/init.d/ushare enable
reboot
?
profit

weereew wrote:

tried addto rc.local???doesn't work

i can now only activate ushare after loginto SSH with the following command:

/etc/init.d/ushare start

what is wrong?

my environment is the nowest snapshots Trunk version  (r30639)

I have the same issue but never took time to investigate for the real reason (obviously a race in startup scripts), but delaying the start of ushare does the trick, insert a sleep 10 before service_start in /etc/init/d/ushare

Please also note that the people at openwrt still haven't integrated a patch posted over a year ago by someone to fix multiple shared directories. I advise you to use the following in the start_instance() section:

#    SERVICE_UID="$uid" \
#    service_start /usr/bin/ushare -n "${servername:-OpenWrt}" -i "${interface:-br-lan}" -c "${content_directories:-/tmp}" $args ${options}
    local content_dir 
    for content_dir in $content_directories; do 
      append args "-c $content_dir" 
    done 
    [ -n "$content_directories" ] && append args "-c /tmp"
    sleep 10
    service_start /usr/bin/ushare -n "${servername:-OpenWrt}" -i "${interface:-br-lan}" $args ${options}

(Last edited by pl9 on 11 Mar 2012, 01:58)

The discussion might have continued from here.