Help me service don't autostart

OpenWrt 19.07.0-rc2

#!/bin/sh /etc/rc.common

start() {
/usr/bin/rclone mount Encrypt_TD1: /mnt/rclone
--buffer-size 256M
--dir-cache-time 1000h
--poll-interval 15s
--timeout 1h
--umask 002
--user-agent neunghaha28app
--rc-addr &

stop() {
echo stopping

echo shutdown

Start manual ::: working

i need autostart.

append boot block before start block

boot() {
        start && exit 0

don't work.

What is your default shell: env | grep SHELL ? I think the init system is using /bin/sh, which might not like your multiple command not using the multiline separator. Try /bin/sh /etc/init.d/rclone start from command line.

START=6 could be too aggressive: the network is not up yet. Does rclone come up without a network? Try START=99.

Add exec >>/root/rclone.log 2>&1 before the first function to get all the output into a file. This way you will not be flying blind.

don't work.

/bin/sh /etc/init.d/rclone start

Try other things I recommended.

1 Like

Start manual ::: working

/etc/init.d/rclone start

autostart don't work.





and enable your service with

/etc/init.d/rclone enable

i change to START=99 don't work

i enable service don't work autostart

--config <path-to-users-rclone-config>
su - $USER -c $COMMAND 

Don't work .

Dude, enable logging, reboot, then cat /root/rclone.log ....

1 Like

Can you cat /etc/init.d/rclone? I want to see the changes you made...

I do not see the exec line...

Found it. Wrong place: before the first function to get all the output into a file

#!/bin/sh /etc/rc.common

exec >>/root/rclone.log 2>&1

start() {

Thx you working autostart service.

I see log fix problem.

Thx working autostart service. :heart_eyes: :heart_eyes: :heart_eyes:

I edit service.

I see log fix problem.

add --config /root/.config/rclone/rclone.conf

Thx. :heart_eyes: :heart_eyes: :heart_eyes:

1 Like